Home » SQL & PL/SQL » SQL & PL/SQL » how to find top 3 salary of emp table with out using order by clause
how to find top 3 salary of emp table with out using order by clause [message #225712] Wed, 21 March 2007 02:06 Go to next message
navinphavade
Messages: 7
Registered: March 2007
Location: Pune
Junior Member
hi i am instered in to find out top 3 salary of emp table with out using order by clause

thanks in adv
Re: how to find top 3 salary of emp table with out using order by clause [message #225713 is a reply to message #225712] Wed, 21 March 2007 02:16 Go to previous messageGo to next message
pavuluri
Messages: 247
Registered: January 2007
Senior Member
see this

select * from emp e where 3>(select count(*) from emp where sal>e.sal)

Thanks,
srinivas
Re: how to find top 3 salary of emp table with out using order by clause [message #225714 is a reply to message #225712] Wed, 21 March 2007 02:16 Go to previous messageGo to next message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Have a look at:

http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/functions123.htm#sthref1878
Regards
Michel
Re: how to find top 3 salary of emp table with out using order by clause [message #225716 is a reply to message #225712] Wed, 21 March 2007 02:22 Go to previous messageGo to next message
navinphavade
Messages: 7
Registered: March 2007
Location: Pune
Junior Member
thanks
Re: how to find top 3 salary of emp table with out using order by clause [message #225718 is a reply to message #225716] Wed, 21 March 2007 02:24 Go to previous message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
For alternatives, search the board.

http://www.orafaq.com/forum/fa/448/0/

MHE
Previous Topic: ORA-00902: invalid datatype
Next Topic: HOW TO CHANGE PARTICULAR STRING IN A COLUMN
Goto Forum:
  


Current Time: Thu Dec 08 14:20:31 CST 2016

Total time taken to generate the page: 0.06279 seconds