
Use the CASE Statement in a SQL SELECT Clause
SQL Server provides a mechanism for returning different values in a SELECT clause based on Boolean conditions: the CASE statement. This statement resembles Visual Basics Select Case statement. The SQL CASE statement has WHEN, THEN, and ELSE clauses along with an END terminator. The syntax is: CASE [expression] WHEN [value