Thursday, 20 August 2015

SQL interview questions

How do you change the value for gender field in a table from Male to Female and vice versa.

update employees set gender = case gender when 'Male' then 'Female' when 'Female' then 'Male'     else 'Other' end

No comments:

Post a Comment