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


Please Help Members By Posting Answers For Below Questions

Name some usages of database trigger?

562


Is microsoft sql free?

601


What is the difference between left and left outer join?

513


What is left join in postgresql?

539


What is a loop in sql?

565






What are the disadvantages of file system?

617


How many types of triggers are there in pl sql?

572


what is difference between delete and truncate commands? : Sql dba

575


How to process query result in pl/sql?

562


Explain architecture of sql server notification services?

622


Why is sql better than hql?

506


Explain select statements in sql?

587


What is an index? What are the types of indexes? How many clustered indexes can be created on a table?

551


can a stored procedure call itself or recursive stored procedure? How much level sp nesting is possible? : Sql dba

531


Can you call pl/sql package functions from within a fast formula?

560