select query [message #18633] |
Thu, 07 February 2002 20:14 |
krishna
Messages: 141 Registered: October 1998
|
Senior Member |
|
|
How do i write a sql select statement for selecting the name of the person getting the fifth highest salary from the emp table? What is the syntax?
|
|
|
Re: select query [message #18637 is a reply to message #18633] |
Fri, 08 February 2002 01:04 |
pratap kumar tripathy
Messages: 660 Registered: January 2002
|
Senior Member |
|
|
try one of these
select * from emp e1
where 4=(select count(*) from emp e2 where e2.sal>e1.sal)
select e1.empno
from emp e1,emp e2
where e2.sal>e1.sal
group by e1.empno
having count(*) =4
|
|
|