May 13, 2011 at 2:53 am
Hello there,
I have two tables A and B. I Want to remove the rows in B that doesnt exist in A. Hence I have tried the following but it seems like there's some issues with the syntax. I looked all over and didnt seem to figure it out yet. Would u guys have any idea?
Delete from B except select * from A
Cheers
Clement.store
May 13, 2011 at 3:09 am
Syntax will look like ,
delete b from b where not exists(select 'x' from a where a.id=b.id)
May 13, 2011 at 3:30 am
Thanks. Can this be done using intersect/except...? Guess this can be a little faster using sets...?
May 13, 2011 at 3:41 am
The proposed solution does use sets - at least in the background.
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
May 13, 2011 at 8:31 pm
thanks all of u guys. Trying it out.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply