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 |
1. Display the post code and the purchase order number for each purchase order. Sort the output set by postcode.
why can't we assign not null constraint as table level constraint
What is the difference between primary key and unique key and foreign key in oracle?
What are data pump export and import modes?
WHAT IS THE DIFFERENCE BETWEEN PRIMARY KEY(PK) CONSTRAINT AND UNIQUE KEY(UK) + NOT NULL(NN) CONSTRAINT ASSIGN TO A COLUMN ? INSTEAD OF ASSIGNING PK ,WE CAN ASSIGN UK + NN TO A COLUMN. WHAT ARE THE MARRITS AND DEMARITS BETWEEN THE ABOVE TWO?THE ABOVE TWO ARE SAME,THEY DON'T ALLOW DUPLICATE AS WELL AS NULL VALUES.
How to write numeric literals in oracle?
what are different types of deletes?
What is a nested table and how is it different from a normal table?
How to create id with auto_increment on oracle?
What is oracle rownum?
Is primary key = unique key,not null? If yes,please explain IF No,please explain
How do I connect to oracle?