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
 Script Library
 max value

Author  Topic 

hanaveenkumar
Starting Member

2 Posts

Posted - 2010-03-01 : 02:53:37
how to get maximum value from a table in sql server and compare that with a value?

Thanks
naveen

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-03-01 : 02:55:53
SELECT max(col) as max_value FROM your_table

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2010-03-01 : 02:56:30
[code]
select max(value)
from atable
[/code]

Compare with what value ?

Where does the value comes from ? Variable or column in table ?

What do you want to do after compare ?

By the way, Script Library is not meant for asking question, it is for posting / sharing written working script


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2010-03-01 : 03:44:02
continue on http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=140595


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -