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
 Select the max value of multiple columns

Author  Topic 

mavershang
Posting Yak Master

111 Posts

Posted - 2009-02-19 : 18:14:55
Hi all. My question is about to select the max value of multiple columns.

For instance,
the table is like
col1 col2 col3 col4 col5
aa 1 2 4 6
bb 8 7 1 3
cc 11 3 1 10
...

The output I want is like
-------------------
aa 6
bb 8
cc 11
....
--------------------
which is for each row, the max value of col2-col5 together with the value of col1.

Thanks.

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-02-19 : 18:31:00
Please donot post everywhere:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=120185
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-02-19 : 18:35:52
Duplicate, locking thread.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -