View Single Post
  #28 (permalink)  
Old 06-15-2008, 08:53 PM
Unregistered
 
Posts: n/a
Exclamation ANY answer. Re: How to find second highest value of a column in a table?

Quote:
Originally Posted by ashin View Post
Hi..is it possible to write the same query without using top & max...
can anyone tell me??

Yes it is possible to answer by using correlated queries.

[sql]select sal from emp e where 1=(select count(*) from emp where e.sal<sal);[/sql]


This is a cheap query written..............asdfadfaaf
Hi...
even I checked this out but could not understand what is happening. Can someone please explain to me what is happening here?
how the value '1' is used to get the second highest value???
Reply With Quote