Hi,
I have two tables Tbl1 and Tbl2. Tble2 is a Subset of Tbl1. I want to Return the values in Tbl1 MINUS the values in Tbl2. So, I used Set Operator MINUS that [blue]"Removes the result of the second query that are also found in the first Query and only displays the rows that were uniquely returned by only the first query".[/blue]
My code Below:
SELECT A.CUST_ID, A.CUST_NAME FROM tbl1 A
MINUS
SELECT B.CUST_ID, B.CUST_NAME FROM tbl2 B;
I tried to use other SET OPERATORS e.g. UNION and UNION ALL
and they work fine. Is the operator MINUS doesnt comply with ACCESS 2002 or am I making a mistake in the SELECT Stmt.??
Also, what other ways can I achieve what I'm trying to do here. I tried to use an OUTER RIGHT JOIN Stmt. but it was returning the INTERSECT of Tbl1 and Tbl2 which is Tbl2, and I want to return Tble1 MINUS Tbl2.
I have two tables Tbl1 and Tbl2. Tble2 is a Subset of Tbl1. I want to Return the values in Tbl1 MINUS the values in Tbl2. So, I used Set Operator MINUS that [blue]"Removes the result of the second query that are also found in the first Query and only displays the rows that were uniquely returned by only the first query".[/blue]
My code Below:
SELECT A.CUST_ID, A.CUST_NAME FROM tbl1 A
MINUS
SELECT B.CUST_ID, B.CUST_NAME FROM tbl2 B;
I tried to use other SET OPERATORS e.g. UNION and UNION ALL
and they work fine. Is the operator MINUS doesnt comply with ACCESS 2002 or am I making a mistake in the SELECT Stmt.??
Also, what other ways can I achieve what I'm trying to do here. I tried to use an OUTER RIGHT JOIN Stmt. but it was returning the INTERSECT of Tbl1 and Tbl2 which is Tbl2, and I want to return Tble1 MINUS Tbl2.