ralphp1355
asked on
SQL - Sql Server - Using CASE statement - how to filter results
Using SQL CASE with Search criteria but all lines coming back - how do I limit to just the rows matching the case statement?
EX:
select name, 'SEX' =
CASE
when ('sex = m' then 'Male')
END
just want to return all the Male and not have an empty row for females?!?!?!?
EX:
select name, 'SEX' =
CASE
when ('sex = m' then 'Male')
END
just want to return all the Male and not have an empty row for females?!?!?!?
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
select name, 'Male' [SEX]
from table
where sex = 'm'