Error for two intersecting queries

Tools
Enthusiast

Error for two intersecting queries

How do i generate a error ,when a set of records ina query do not intersect a set of records in another query.
For eg,
if I have a query ,

select A,b from ABC
INTERSECT
select B,d from XYZ

I want to display all records in ABC which do not intersect the b,d in XYZ.
What logic do I use ?

Thank you,
az_maverick
2 REPLIES
rgs
Enthusiast

Re: Error for two intersecting queries

I think you want to use the EXCEPT operator not the INTERSECT.
Enthusiast

Re: Error for two intersecting queries

Intersect operator will bring common values between two sets.
And if you want duplicate rows also ,you have to use INTERSECT ALL.
MINUS or EXCEPT operator will solve your query....
It is used when we want to do A-B(A EXCEPT B) on common domain values.