select min(c1)
from (select c1 from z_tab order by c1 desc)
where rownum < 3
Tomaž "A common mistake that people make when trying to design something completely
foolproof is to underestimate the ingenuity of complete fools" - Douglas Adams
Originally posted by nour
- first sql statement to have the max-1 : 13
- second sql statement to have max-2 : 11
- ...
You want SQL Statements or Values in that order?
Later is pretty easy...
If you want SQL Statements then you can think of having some thing like this
Code:
TEST:ABHAY> ed
Wrote file afiedt.buf
Select 'Select * from TEST Where ID='||ID "SQL Statement" from TEST where ID != ( Select Max(ID) from TEST )
Order By 1 Desc
SQL Statement
-----------------------------------
Select * from TEST Where ID=4 -- Max-1
Select * from TEST Where ID=3 -- Max-2
Select * from TEST Where ID=2 ..
Select * from TEST Where ID=1 ..
Abhay.
funky...
"I Dont Want To Follow A Path, I would Rather Go Where There Is No Path And Leave A Trail."
"Ego is the worst thing many have, try to overcome it & you will be the best, if not good, person on this earth"
Bookmarks