How do i use MINUS operator for two different data tables

How do i use MINUS operator for two different data tables

  

Dear friends,

How do i MINUS this the data in User Table from ADetails table?

i have tried:

SELECT {User}.[Name]
FROM {User}
MINUS
SELECT {ADetails}.[Name]
FROM {ADetails}
SELECT {User}.[Name]
FROM {User}
INTERSECT
SELECT {ADetails}.[Name]
FROM {ADetails}


Would appreciate any help...please

Solution

Hi Wei Ren,

MINUS seems Oracle-specific, the Microsoft SQL equivalent is EXCEPT. You say you have tried SQL, what went wrong / didn't work?

I'm not too familiar with either EXCEPT or INTERSECT. I think both can be rewritten as a subquery in SQL (WHERE ... IN / NOT IN)? When using an Aggregate, I guess you could join the tables, and set the appropriate Filter ("With or Without" with test on Id being NullIdentifier() for EXCEPT, "Only With" for INTERSECT).

Solution