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
 Finding The Highest Number

Author  Topic 

spooke
Starting Member

7 Posts

Posted - 2012-01-08 : 04:31:34
I am trying to find the highest number in a column however all it seems to do is return the lowest... anyone got any ideas?

USE bets
GO
SELECT TOP(1)
[Team Two],
MAX(Odds) AS "Highest Odds"
FROM NBA
GROUP BY
[Team Two]
ORDER BY
MAX(Odds);
GO

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-01-08 : 04:37:55
[code]....
ORDER BY
MAX(Odds) DESC[/code]
By default order by assumes ascending sort. You can request descending sort as shown above
Go to Top of Page
   

- Advertisement -