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
how many values can the set function of mysql take? : Sql dba
How is sql used in oracle?
How can triggers be used for the table auditing?
What do you understand by case manipulation functions?
What is the use of index in hive?
Can triggers stop a dml statement from executing on a table?
what is the use of friend function? : Sql dba
Can a composite key be null?
How does sql store data?
Do stored procedures prevent sql injection?
Is sql a backend language?
explain the difference between bool, tinyint and bit. : Sql dba
What is meant by <> in sql?
What is a sql instance vs database?
Is drop table faster than truncate?