All Forums Tools
az_maverick 24 posts Joined 03/09
30 Mar 2009
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 XYZI 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

rgs 106 posts Joined 02/07
30 Mar 2009

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

prakhar 101 posts Joined 05/08
30 Mar 2009

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.

You must sign in to leave a comment.