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 table? : Sql dba

570


Can unique keys be null?

480


How do I install microsoft sql?

520


Which is faster joins or subqueries?

547


How to run sql statements through the web interface?

503






Is big data nosql?

506


What is data type in database?

539


What do we need to check in database testing?

550


Explain 3 basic parts of a trigger.

826


What is sql*plus?

563


What are the subsets of sql?

543


What is pl sql block structure?

533


What is a null value?

653


Why is %isopen always false for an implicit cursor?

564


Can we insert delete data in view?

537