Hi,
Plz. Try this out
SELECT * FROM (SELECT MAX(col1) FROM table1 ORDER BY MAX(col1) desc )
WHERE rownum <3
Thanks & Regards,
Manish Deswal
-----Original Message-----
From: Imran Sheikh
[mailto:oracledba-ezmlmshield-x29827903.[Email address protected]
Sent: Monday, April 30, 2007 4:32 PM
To: LazyDBA Discussion
Subject: max rows
Dear all,
Can I get two max rows in a query like:
Select max(col1)
From table1
Now if it returns 10 rows I want to get only 2 highest value rows.
Thanks,
---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
============================================================================================================================
Disclaimer:
This message and the information contained herein is proprietary and confidential and subject to the Tech Mahindra policy statement, you may review at <a href="http://www.techmahindra.com/Disclaimer.html">http://www.techmahindra.com/Disclaimer.html</a> externally and <a href="http://tim.techmahindra.com/Disclaimer.html">http://tim.techmahindra.com/Disclaimer.html</a> internally within Tech Mahindra.
============================================================================================================================
Oracle LazyDBA home page