Prashant Tiwari
Newbie
Points: 4
More actions
July 31, 2005 at 11:58 am
#165101
Please help me regarding Query to find second largest number in the column....
David Todd-242471
Right there with Babe
Points: 797
July 31, 2005 at 4:15 pm
#578388
Hi,
Try something like:
select max( column-Name )
from table-Name
where column-Name <
(
)
Regards
David
MKulangara
SSC Enthusiast
Points: 142
August 1, 2005 at 10:11 am
#578602
This would work too..
select top 1 *
from
(select top 2 [value_to_compare],[other_fields]
from foo
order by [value_to_compare] desc
)q
order by [value_to_compare] asc
if you wanted the third item you would change 2 to 3 ..etc
HTH
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply