Hello everybody,
hope you are fine.
i am looking for a solution for the following task:
I have two tables:
customers
ID CUSTOMERNAME
bookings
ID CUSTOMERID AMOUNT
I have customers who have already purchased something. So I can
easily get the amount with:
Select customers.customername, sum(amount) as amount from bookings, customers where customers.id=bookings.customerid AND customers.id = ?
Now I would like to have an overview with the customers who have no entries
in the bookings table (amount = 0.00) and those ones who have purchased something
yet. I tried UNION, but then you 2 entries when somebody has purchased something.
hope you are fine.
i am looking for a solution for the following task:
I have two tables:
customers
ID CUSTOMERNAME
bookings
ID CUSTOMERID AMOUNT
I have customers who have already purchased something. So I can
easily get the amount with:
Select customers.customername, sum(amount) as amount from bookings, customers where customers.id=bookings.customerid AND customers.id = ?
Now I would like to have an overview with the customers who have no entries
in the bookings table (amount = 0.00) and those ones who have purchased something
yet. I tried UNION, but then you 2 entries when somebody has purchased something.
Last edited: