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.
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / 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 |
Answer / 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 |
Answer / sushma s
Update table_name
Set gender = decode(gender,'M','F','M');
Is This Answer Correct ? | 8 Yes | 9 No |
How does an execution block start and end in pl sql?
What is the difference between pl and sql?
What does the hierarchical profiler does?
how can we destroy the cookie? : Sql dba
What is the syntax to add a record to a table?
What is difference between sql function and stored procedure?
Where is pl sql used?
What is pl sql and why it is used for?
How many developers work on postgresql?
how to get a list of all tables in a database? : Sql dba
How does index help in query performance?
what are enums used for in mysql? : Sql dba