One Table having two rows with one colomn having values
Like"Male" and "Female". how to upadte these values
Like "Female" and "Male" in single update statement.
Answers were Sorted based on User's Feedback
Answer / murali mohan
Try this,
update testsamp1 set c=decode
(c,'MALE','FEMALE','FEMALE','MALE');
Regards,
Murali
| Is This Answer Correct ? | 8 Yes | 1 No |
Answer / selvaraj anna university coe
UPDATE Eptbl SET Sex=DECODE
(Sex,'Male','Female','Female','Male');
| Is This Answer Correct ? | 8 Yes | 1 No |
Answer / brahma prakash
Murali your answer is not running on postgres database
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / hitendra yadav
--Try this
UPDATE Eptbl
SET Sex= CASE WHEN SEX='Male'
THEN 'Female'
ELSE 'Male'
END;
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / apsar
update tbl_name set (a,b) = (select b,a from tbl_name where a='Male');
| Is This Answer Correct ? | 0 Yes | 0 No |
How would you design a database for an e-commerce website?
What is an UTL_FILE.What are different procedures and functions associated with it?
Can we create more than one index on particular column?
 How to use an oracle sequence generator in a mapping?
How to delete multiple rows from a table in oracle?
Can a formula column be obtained through a select statement ?
2. Display the post code and the total number of purchase orders placed with creditors in that post code.
Explain oracle’s system global area (sga).
How much memory your 10g xe server is using?
An automatic job running via DBMS_JOB has failedKnowing only that its failed, how do you approach troubleshooting this issue?
What is an oracle user account?
How to specify default values in insert statement using oracle?