Reputation: 41
How to replace the values 1 and 2 by "Male" and "Female" respectively in a table while selecting using single select query?
Name Gender
a 1
a 2
Upvotes: 1
Views: 4769
Reputation: 238086
select Name
, case Gender
when 1 then 'Male'
when 2 then 'Female'
end as Gender
from YourTable
Upvotes: 7