Let's say I have 2 tables, tableNames and tableSales.
How would I select all of the names from tableNames that don't exist in tableSales, or exist in tableSales but have 0 sales?
tableNames has 1 column for names, tableSales has 2 columns for names and amount.
This is an example but very close to my real problem. Here's what I have so far (again exemplified):
SELECT tableNames.Name, tableSales.Amount
FROM tableNames LEFT JOIN tableSales ON tableNames.Name = tableSales.Name
WHERE tableNames.Name<>tableSales.Name OR tableSales.Amount=0
Thanks in advance.
How would I select all of the names from tableNames that don't exist in tableSales, or exist in tableSales but have 0 sales?
tableNames has 1 column for names, tableSales has 2 columns for names and amount.
This is an example but very close to my real problem. Here's what I have so far (again exemplified):
SELECT tableNames.Name, tableSales.Amount
FROM tableNames LEFT JOIN tableSales ON tableNames.Name = tableSales.Name
WHERE tableNames.Name<>tableSales.Name OR tableSales.Amount=0
Thanks in advance.