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 run sql*plus commands that are stored in a local file?
How to use sql statements in pl/sql?
What is an oracle stored procedure?
Is keyword pl sql?
How do I view a table in sql?
how to select unique records from a table? : Sql dba
What are the two parts of design view?
What is the purpose of primary key?
What is the difference between a primary key and a clustered index?
List the various privileges that a user can grant to another user?
What is gpt format?
What is aggregate function in sql?
What is cascade in sql?
Does truncate require commit?
How delete all data from all tables in sql?