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 to get execution path reports on query statements?
Hi how Can I Add A Foreign key that references a table that has composit primary key ? example i had costumer table that has C_Id and SSN Both as PK and another table has C_Id that must refernece C_Id in Customers i done the usual way and got oracle error message about uniqeness any ideas plz
What is a cognitive schema?
Explain the difference between a procedure and a function?
What is integrity and what is constraint??Explain with example
I just want to maintain data like an employee can belongs to 3 or more departments . We can resolve this by using composite key but it avoids normalization rules. So Can anyone tell me how can I maintain data.
Explain cascading triggers.
Define 'view' advantage ?
How view is different from a table?
How to assign values to data fields in record variables?
can we pass two out parameters at a time in function?please answer to my question
What is the difference between substr & instr functions?