View Single Post
  #15 (permalink)  
Old 10-24-2007, 12:07 PM
Unregistered
 
Posts: n/a
Default ANY answer. Re: How to find second highest value of a column in a table?

Quote:
Originally Posted by ruby View Post
I have a table - Trade with 2 columns -Client name and quantity.
I want to find out the name of the client with second highest quantity. How do I proceed?

[sql]select quantity from trade a where 2=(select count(quantity) from trade b where a.quantity<=b.quantity);[/sql]

-hello friend this query is called nested sub query this is the only way to find the values in given count order
Reply With Quote