Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Update multiple rows & columns using a single statement

634624Jul 11 2008 — edited Jul 11 2008
I have the following table with tablename - emp

first_name last_name age
--------------- --------------- ----
aaa bbb 31
56
78
ggg hhh 36

-----------------------------------------------
2nd & 3rd row contain null values (no data) in first_name & last_name column . I want to update those two rows with data using a single statement. How do I do it?

I was thinking may be something like the following:-
----------------------------------------------
UPDATE emp
SET first_name= , last_name=
CASE
WHEN age = 56 THEN 'ccc', 'ddd'
WHEN age = 78 THEN 'eee', 'fff'
ELSE first_name, last_name
END
-----------------------------------------------
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 8 2008
Added on Jul 11 2008
17 comments
4,526 views