In this post, we will discuss how to use a case statement in SQL server 2008.
You can also check my previous posts on
WHEN expression1 THEN expression1
[[WHEN expression2 THEN expression2] […]]
select Case Gender when 0 then ‘Male’ else ‘Female’ end as Gender from UserMaster where UserID=1
The above query will return Male of Gender field is 0 else it return Female.
Also Check below example where you can have multiple WHEN statements:
select SiteURL,SiteName =
WHEN 1 THEN ‘EnjoySharePoint.com’
WHEN 2 THEN ‘AspDotNetHelp.Com’
WHEN 3 THEN ‘Fewlines4Biju.com’
ELSE ‘No Site Available’
END from WebSite
Download FREE SharePoint 2019 Installation PDF Guide
This FREE PDF contains, Steps by step guide to install SharePoint 2019 Preview, prerequisites, hardware and software new features. First impression to SharePoint Server 2019 new modern site, modern lists and modern document libraries.
You May Also like the Following SharePoint Online Tutorials: