RSS

Sql CASE With IN

The Bellow statements used to access the CASE With IN Condtions for Selecting the city Names


DECLARE @City AS Varchar(30)
SELECT buildingid,(
CASE
WHEN buildingid IN (1,2,3)
THEN 'Chennai'
WHEN buildingid=6
THEN 'Madurai'
WHEN buildingid=7
THEN 'Thiruchy'
ELSE ''
END) AS 'City Name'
FROM tHMSFloor

read comments Read User's Comments