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 and DELETE in one script

832376Aug 29 2011 — edited Aug 29 2011
Is it possible to have an UPDATE statement and a DELETE statement in the one script or do they have to be seperate.

I'm working with data similar to this -

time---------------id------type
01-Jan-2011----123----A
01-Jan-2011----123----B
02-Jan-2011----123----A
02-Jan-2011----123----B
03-Jan-2011----123----A
04-Jan-2011----123----A
04-Jan-2011----123----B
05-Jan-2011----123----A

I want to find records of Type A which also have a Type B for the same date.

I then want to update the Type B to a Type C and delete the Type A record.

So after running the script the data will look like this -

time---------------id------type
01-Jan-2011----123----C
02-Jan-2011----123----C
03-Jan-2011----123----A
04-Jan-2011----123----C
05-Jan-2011----123----A

Any help whatsoever would be very helpful.

Cheers
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 26 2011
Added on Aug 29 2011
4 comments
192 views