Link to home
Start Free TrialLog in
Avatar of Fraser_Admin
Fraser_AdminFlag for Canada

asked on

Query Question

I have the following table A, together the 2 columns make a key:
CardNumber
Profile

Then I have table B which is a subset of table A same columns.

How can I get the values which are in table A which are not in table B?  I need all the card/profile combinations in A which are not in B.

Thanks
Avatar of ee_rlee
ee_rlee
Flag of Philippines image

try this
SELECT tableA.* FROM tableA LEFT JOIN tableB ON (tableA.CardNumber=tableB.CardNumber AND tableA.Profile=tableB.Profile) WHERE
(tableB.CardNumber IS NULL OR tableB.Profile IS NULL)

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Sachintana Dissanayake
Sachintana Dissanayake
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial