Home » RDBMS Server » Server Administration » SQL QUERY
SQL QUERY [message #373533] Sun, 22 April 2001 02:52 Go to next message
Hanumantha Raju
Messages: 7
Registered: April 2001
Junior Member
How can i dislplay the third highest salary drawing empno in emp table.
Re: SQL QUERY [message #373542 is a reply to message #373533] Mon, 23 April 2001 02:33 Go to previous messageGo to next message
Balamurugan.R
Messages: 91
Registered: March 2001
Member
Hi,

Try this

select empno from emp x where 3=(select count(distinct(sal)) from emp where x.sal<=sal);

Cheers,
Balu
Re: SQL QUERY [message #373567 is a reply to message #373533] Mon, 23 April 2001 15:24 Go to previous message
Jaco
Messages: 23
Registered: August 2000
Junior Member
SELECT MAX(SAL) FROM EMP WHERE SAL<(SELECT MAX(SAL) FROM EMP
WHERE SAL < (SELECT MAX(SAL) FROM EMP))
Previous Topic: how do u I write this sql query
Next Topic: Is there a way to remove duplicates from a table?
Goto Forum:
  


Current Time: Mon Dec 23 09:38:23 CST 2024