View Single Post
  #9 (permalink)  
Old 01-23-2008, 05:01 AM
lavanya lavanya is offline
Junior Member
 
Join Date: Jan 2008
Posts: 2
lavanya is on a distinguished road
Cool ANY answer. Re: i want to get the third highest salary from a table?

I am not sure but it will definitely work just try once.


[sql]( select salary from <tablename> where sal <(select salary from <tablename> where sal <(select max(sal) from <tablename>))) [/sql]

This will give the third highest salary from a table.
And for the second highest salary just remove one phrase that is

[sql]select salary from <tablename> where salary<(select max(salary) from <tablename>)[/sql]
__________________
lavanya kunala


lavanya.kunala@gmail.com
Reply With Quote