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 / ram

UPDATE TABLE
SET GENDER=(CASE GENDER
WHEN 'M' THEN 'F'
WHEN 'F' THEN 'M'
END) WHERE GENDER IN ('M','F')

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between function and trigger?

546


what is sub-query? : Transact sql

597


What is the difference between pl and sql?

545


what are string data types? : Sql dba

511


What is the usage of when clause in trigger?

566






How to create a menu in sqlplus or pl/sql?

613


What is the best sql course?

533


How do you exit in sql?

589


how can we take a backup of a mysql table and how can we restore it. ? : Sql dba

519


Can we create view in stored procedure?

525


How can I get the number of records affected by a stored procedure?

574


What is the sql*loader? : aql loader

589


What is sql comments?

650


Why do you partition data?

534


Write a sql query to convert all character to uppercase after hypen.

958