UPDATE and DELETE in one script
832376Aug 29 2011 — edited Aug 29 2011Is 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