Skip to content
Advertisement

How to write a Query to find out if the item has been purchased in the last year

I have a table ,where I have fields like Item and Purchase date. There are multiple entries of item purchased on different dates. I want to only select those items that are NOT purchased in the last 12 months. For eg. as shown below, I just need the value of ‘IPad’ as it has never been purchased in last 12 months.

How can I achieve it using an Oracle sql query ?

Advertisement

Answer

With NOT EXISTS:

or:

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement