The blog has moved to the new site F10Debug.com

Friday, September 11, 2015

Case Statement in SQL Server

According to msdn : Evaluates a list of conditions and returns one of multiple possible result expressions.

The SQL Server (Transact-SQL) CASE statement is similer to IF-THEN-ELSE statement. You can use the CASE statement within a SQL statement.

Syntax:

 case 
         When expression1 then result1

         When expression2 then result2

          else result
 end







No comments:

Post a Comment