D
dhstein
I'm not looking for the exact syntax here - just an idea of what the SQL
statement might look like.
The situation is we have a table of invoices.
Each record has a customer name, an invoice number, and a date of
the invoice. We also have a table of line items - each record has an
invoice number and a line item that was purchased - so this is a one to many
relationship (one invoice to many lines). We want to find the customer names
who have purchased a specific item - for example Black Sneakers - but the
purchase was not the first time the customer made a purchase - maybe last
time they purchased blue sandals. So the item has to appear on a customer
invoice but the customer had purchased some other items on a previous
invoice. So the query would provide the list of RETURNING customers who are
purchasing black sneakers.
Thanks for any help on this.
statement might look like.
The situation is we have a table of invoices.
Each record has a customer name, an invoice number, and a date of
the invoice. We also have a table of line items - each record has an
invoice number and a line item that was purchased - so this is a one to many
relationship (one invoice to many lines). We want to find the customer names
who have purchased a specific item - for example Black Sneakers - but the
purchase was not the first time the customer made a purchase - maybe last
time they purchased blue sandals. So the item has to appear on a customer
invoice but the customer had purchased some other items on a previous
invoice. So the query would provide the list of RETURNING customers who are
purchasing black sneakers.
Thanks for any help on this.