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
How do I add a database to sql?
What does pragma mean?
What is sqlite used for?
explain what is mysql? : Sql dba
What are two statement types in sql?
How do I save the results of sql query in a file?
How we can update the view?
How to avoid duplicate records in a query?
how can we destroy the cookie? : Sql dba
what is the stuff function and how does it differ from the replace function? : Sql dba
Is it possible to Restore a Dropped Table using Rollback Command in Oracle SQL Plus ?
What is difference between rank () row_number () and dense_rank () in sql?
What is difference between group by and partition by?
what are local and global variables and their differences? : Sql dba
Can we create table in function?