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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2004-04-19 : 11:00:15
|
| Chris R writes "I have exisitng production table (SQL Server 7.0) with several thousand records and I wish to add a computed column that computes the max value from a number of other columns in the same record.I know MAX works on columns of data but can I use something similar for my computed column ?" |
|
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
Posted - 2004-04-19 : 11:55:53
|
| you may have to go down the route of something like the following....and put the CASE statement into the definition of the COMPUTED columnselect col1, case when (col2 > col3 and col2 > col4) then col2 when (col3 > col2 and col3 > col4) then col3 else col4endfrom tablename |
 |
|
|
|
|
|