Link to home
Create AccountLog in
Avatar of dog_star
dog_star

asked on

A simple SQL exclusion question

hi,

i have a customers table and an orders table in my client's database...

in the customers table there is a boolean value for "dealer" (ie whether they're are a dealer or not)

in the orders table there is "customers_id" column for the id number of the customer (funnily enough :))

now, my client want a list of all dealers who signed up within a certain period but haven't placed an order...

could someone help me with the SQL to produce this list

many thanks in advance for any help
Avatar of Binuth
Binuth
Flag of India image

SELECT customers .*
FROM customers
LEFT JOIN orders ON customers.customers_id= orders.customers_id
WHERE customers.dealer = 1
ASKER CERTIFIED SOLUTION
Avatar of pesmerg
pesmerg
Flag of Türkiye image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of dog_star
dog_star

ASKER

manythanks for your help