Based on the SELECT CASE below I want to show two separate columns within one WHEN. Is this possible?
The two commented out lines below are something like what I would like to have. I am sure it is something very simple I am missing. As it is, there is a syntax error.
select
person.FirstName,
person.LastName,
CASE
--WHEN substatus is not null then 'HasSubstatus', null
--else null, 'DoesNotHaveSubstatus'
WHEN substatus is not null then 'HasSubstatus'
else null
end
from Person person
You cannot do it in a single Case expressions as a Case expression returns a single value. You must use two Case expressions.