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 / parli jain

Update table_name
set Gender = decode (Gender, 'M', 'F', 'F,'M')
where Gender In ('M','F');

Is This Answer Correct ?    29 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What will you get by the cursor attribute sql%found?

534


what are date and time data types? : Sql dba

534


What is mutating error?

504


how to get a list of all tables in a database? : Sql dba

511


What does pragma mean?

505






Why do we need a foreign key?

549


Table A Table B 1 1 2 1 3 1. Union & union all --> A Union B , A Union all B 2. Minus , Intersect --> A minus B , B Minus A , A Intersect B 3. Joins A join B , A Left Join B A Right Join B , A full Join B 4. %Type - Uses & Benifit 5. Truncate & Delete 6. Pragma Autonomus Transaction 7. how to Perform DDL from function or procedure 8. Can we have DML inside Function 9. Rank & Dense Rank diffrence 10. Water Mark in Oracle 11. Index , Can we have index in all column of table if no then why ?

534


Explain mutating table error.

647


Which version of sql do I have?

559


What are all the common sql functions?

559


what is bdb (berkeleydb)? : Sql dba

567


What is the difference between a query and a report?

518


Describe sql comments?

559


What is pl sql collection?

524


What do you understand by pl/sql packages?

569