|
-
Query Advice - Probably simple
Hi,
Quite new to SQL. I have been asked to query two tables to find which combinations of CustomerID and ProductID exist in one but not the other. I am concatenating the fields in the query to produce a combination I can query ( see below)
This seems to work but takes along time - I'm sure there must be a better way of doing this? Please bear in mind I am a novice in your responses!
select distinct(ProductID),CustomerID from customerpackproduct where
str(ProductID) + str(CustomerID) not in
(select str(ProductID) + str(CustomerID) from customerproduct)
order by customerid
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|