Table row values??? | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Table row values???

Hi, I have a table
Name SSN
—- —-
Debra 0
Ray 1
John 1
I want to write a query so that it selects Name and SSN from the above table.
But in the output table it should return
Name SSN
—- —-
Debra Nothing there
Ray Something there
John Something there so if SSN = 0
if SSN = 1, do the above

select Name,
SSN = case when SSN = 0 then ‘Nothing there’ else ‘Something there’ end
from tbl KH
Check this link for more info on using CASE in T-SQL:
http://msdn2.microsoft.com/en-us/library/ms181765.aspx
]]>