I’m having a bit of problem understanding outer join, I think. This is a school-related problem; usually I don’t ask those here, but I can’t seem to get it to work.
I have a table Customer, which includes customerID, and other customer info.
I also have a table named Orders, which includes customerID, what was bought, and how many.
Now, I just want to list all the customers who haven’t bought anything, (That is, their customer ID is not in the Orders table.)
Can you help?
Depending on the indexes you have, there are few ways to do this:
OUTER JOIN
SUBSET QUERY
SET DIFFERENCE
First method may be actually the worst in terms of performance, third is the easiest I think, but you cant retrieve additional info about customer, the second is probably the same as third in terms of performance, and still you can retrieve additional customer info.