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 / 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 |
Post New Answer View All Answers
Are there any features that are decommissioned in 11g that are not present in 11g?
What is sql in oracle?
What is the need of a partition key?
Can a procedure in a package be overloaded?
describe transaction-safe table types in mysql : sql dba
How to pronounce postgresql?
What program will open a mdb file?
Mention what plvcmt and plvrb does in pl/sql?
How do you select unique values in sql?
What is the function that is used to transfer a pl/sql table log to a database table?
Is primary key an index?
Table 1: col1 Timestamp ---------------- 01-mar-2012 11:12:46 Table 2: col2 Timestamp -------------------- 01-mar-2012 11:12:10 01-mar-2012 11:11:23 Write a query to display a row with table2 col2 value less than tabl1 col1 value. Maximum timestamp value previous to table1 col1 value. Display a result as: Col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10
Why use triggers in sql?
what is bcp? When does it used? : Sql dba
What are the different parts of a package?