How do I do multiple CASE WHEN conditions using SQL Server 2008?

前端 未结 10 1954
被撕碎了的回忆
被撕碎了的回忆 2020-11-27 09:57

What I\'m trying to do is use more than one CASE WHEN condition for the same column.

Here is my code for the query:

   SELECT   Url=\'\',
                    


        
10条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-27 10:38

    Its just that you need multiple When for a single case to behave it like if.. Elseif else..

       Case when 1=1       //if
       Then
        When 1=1              //else if
         Then.... 
        When .....              //else if
        Then 
        Else                      //else
       ....... 
         End
    

提交回复
热议问题