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 can we know the number of days between two given dates using mysql? : Sql dba
What is a sql trace file?
How do you copy a table in sql?
Do we need to create index on primary key?
How do you declare a user-defined exception?
Define sql delete statement.
what is the difference between where clause and having clause? : Sql dba
Do we need to rebuild index after truncate?
How can we make an if statement within a select statement?
how to create temparary sequence
If an unique key constraint on DATE column is created, will it validate the rows that are inserted with SYSDATE?
Explain two easy sql optimizations.
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)