I currently have Table1 that includes
ID Gender
1 m
2 f
3 f
4 m
5 f
6 f
Now i am looking to insert this data into a second table (Table2). But basically i am trying to insert it with the words 'Male' and 'Female'. So for example when Gender = 'm' in table 1 i want to insert the char 'Male' into the second table (table2) and the same for female.
I created some code such as
UPDATE Table2
SET
Gender =
( CASE WHEN Table1.Gender = 'm' THEN 'Male'
WHEN Table1.Gender = 'f' THEN 'Female'
ELSE 'N/a'
END)
I have an SQL Fiddle schema if that is of any help -
http://sqlfiddle.com/#!9/8a3080
Thanks