Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Top ten results

Author  Topic 

bennym
Starting Member

1 Post

Posted - 2006-02-23 : 11:39:15
Hi can anyone help me maybe im just being thick but i cant for the life of me work out how to get the top ten results based on the highest number within a column

ie.

top2 would be

name1 4
name2 8
name3 102
name4 113


i want name3 and name4 to be returned

SIMPLE well it should be aRRRRGGG HELP!!!

i have tried using max but that only returns the highest
how i get the next highest etc i dont know

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2006-02-23 : 11:41:46
select top 10 * from table
order by secondcolumn desc
Go to Top of Page
   

- Advertisement -