Interchange the value of a column Gender in a table where
values are Male and Female. So, where the value is Male, it
should changed to Female and Female to Male.
Answer Posted / raghu
UPDATE TABLE_NAME
SET GENDER=( CASE GENDER
WHEN 'M' THEN 'F'
WHEN 'F' THEN 'M'
END )
WHERE GENDER IN('M','F')
Is This Answer Correct ? | 22 Yes | 2 No |
Post New Answer View All Answers
What is the process of debugging?
What is the purpose of design view?
What is difference between nchar and nvarchar?
What are the different sql languages?
How delete a row in sql?
how to use like conditions? : Sql dba
Can %notfound return null after a fetch?
What is the difference between null value, zero, and blank space?
Is oracle sql free?
what is difference between delete and truncate commands? : Sql dba
What are pl sql procedures?
How many sql are there?
What are the types of variables use in pl sql?
What is %type in pl sql?
Can we update views in sql?