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 are the system privileges that are required by a schema owner (user) to create a trigger on a table?

615


What is sql select statement?

503


What is left join in postgresql?

532


Explain correlated query work?

589


What is difference between sql and oracle?

560






How subquery works in sql?

538


What is the process of debugging?

546


Should I use mbr or gpt?

538


What is a mutating table and a constraining table?

567


how would you get the current date in mysql? : Sql dba

535


Is truncate ddl or dml?

541


what are the other commands to know the structure of table using mysql commands except explain command? : Sql dba

551


What is difference between sql function and stored procedure?

503


Is it important to partition hard disk?

530


How do I view an execution plan in sql?

525