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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 How do i get the highest value ?

Author  Topic 

mary_itohan
Posting Yak Master

191 Posts

Posted - 2008-10-05 : 05:25:22
Hello,
how do i get the highest value in my column called usercount ?

select top 1  usercount from history where batch = 861


Its a column contaning numbers from 1 to ....

Thanks

_____________________


Yes O !

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-05 : 05:38:49
two ways
1.select top 1 usercount from history where batch = 861 order by usercount desc
2.select max(usercount) from history where batch = 861
Go to Top of Page

mary_itohan
Posting Yak Master

191 Posts

Posted - 2008-10-05 : 05:41:48
silly me
Thank you

_____________________


Yes O !
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-05 : 05:44:23
quote:
Originally posted by mary_itohan

silly me
Thank you

_____________________


Yes O !


no worries
you're always welcome
Go to Top of Page
   

- Advertisement -