What's the best way to select the minimum value from several columns?

后端 未结 19 2166
余生分开走
余生分开走 2020-11-27 02:47

Given the following table in SQL Server 2005:

ID   Col1   Col2   Col3
--   ----   ----   ----
1       3     34     76  
2      32    976     24
3       7             


        
19条回答
  •  生来不讨喜
    2020-11-27 03:32

    Both this question And this question try to answer this.

    The recap is that Oracle has a built in function for this, with Sql Server you are stuck either defining a user-defined-function or using case statements.

提交回复
热议问题