![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello, I'm trying to determine the negation of A intersect B quicker than: (A UNION B) MINUS (A INTERSECT B) Is there a standard SQL operator that will do this? |
#3
| |||
| |||
|
|
cdecarlo (AT) gmail (DOT) com wrote: Hello, I'm trying to determine the negation of A intersect B quicker than: (A UNION B) MINUS (A INTERSECT B) Is there a standard SQL operator that will do this? Subselect using NOT IN? Such as SELECT * FROM B WHERE B.id NOT IN ( SELECT id FROM A ) Not tested. It seems to be an equivalent approach, but I am not entirely sure. Regards, Michael. -- Which is more dangerous? TV guided missiles or TV guided families? I am less likely to answer usenet postings by anonymous authors. Visit my home page at http://michael.zedeler.dk/ |
#4
| |||
| |||
|
|
Hello, I'm trying to determine the negation of A intersect B quicker than: (A UNION B) MINUS (A INTERSECT B) Is there a standard SQL operator that will do this? |
#5
| |||
| |||
|
|
In article <1150737539.920386.275540 (AT) u72g2000cwu (DOT) googlegroups.com>, cdecarlo (AT) gmail (DOT) com writes: Hello, I'm trying to determine the negation of A intersect B quicker than: (A UNION B) MINUS (A INTERSECT B) Is there a standard SQL operator that will do this? How about a FULL OUTER JOIN? |
#6
| |||
| |||
|
|
In article <1150737539.920386.275540 (AT) u72g2000cwu (DOT) googlegroups.com>, cdecarlo (AT) gmail (DOT) com writes: Hello, I'm trying to determine the negation of A intersect B quicker than: (A UNION B) MINUS (A INTERSECT B) Is there a standard SQL operator that will do this? How about a FULL OUTER JOIN? |
#7
| |||
| |||
|
|
Thanks for your reply Mike but I don't think that is an equivilant approach. Your query will return the items in B that aren't in A, whereas I'm trying to get the items that are in A or B but not in both A and B. Hope that helps clear things up, if you would like to take another kick at the can. |
#8
| |||
| |||
|
|
cdecarlo (AT) gmail (DOT) com wrote: Thanks for your reply Mike but I don't think that is an equivilant approach. Your query will return the items in B that aren't in A, whereas I'm trying to get the items that are in A or B but not in both A and B. Hope that helps clear things up, if you would like to take another kick at the can. Of course. Didn't read the expression carefully enough to se that it is symmetric, but I did read your text and got confused. I don't see how you would be able to boil it further down, but again, that is not a very useful answer. Will think a little more about it. Regards, Michael. How about FULL OUTER JOIN where key_a IS NULL OR key_b IS NULL |
#9
| |||
| |||
|
|
(A UNION B) MINUS (A INTERSECT B) Is there a standard SQL operator that will do this? |
#10
| |||
| |||
|
|
Hello, I'm trying to determine the negation of A intersect B quicker than: (A UNION B) MINUS (A INTERSECT B) Is there a standard SQL operator that will do this? Thanks Probably in this way. At first createing some tables and feeding with |
![]() |
| Thread Tools | |
| Display Modes | |
| |