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 |
Can we save images in a database and if yes, how?
Explain can a view based on another view?
How to export data with a field delimiter?
You have found corruption in a tablespace that contains static tables that are part of a database that is in NOARCHIVE log mode. How would you restore the tablespace without losing new data in the other tablespaces?
How to select some columns from a table in oracle?
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.
how may join possible between (requisition with purchase order)
What is a Data File ?
Explain index?
Why oracle is used?
How to create a single index for multiple columns?
1:-How to write to update command in a procedure in oracle which update two different table at a time 2:-How to write the select command in a procedure in oracle which give multiple records