Suppose I have following table
ID ITEM QUANTITY DATE
1 A 50 Jan 3, 2013
2 B 80 Jan 1, 2013
3 C 70 Jan 5, 2013
4 D 80 Jan 4, 2013
I have to make a single query which will fetch the record which has highest quantity and highest date. For example, end result should be
4 D 80 Jan 4, 2013
Update: First of all I have to pick the records which have highest quantity. In this case it would be record no. 2 and 4. Then I have to again filter out from these two records which have highest date
How should I make SQL query in ORACLE?
To get those data you could write a query similar to this one: