I am trying to use an IF or CASE statement in sql to choose when to select a value in a column. Essentially I have some data in a table like so: Sample Data Table
My goal is to see which items are ordered multiple weeks in a row by the same customer. I have 1 month of dates, but I can do 7 separate queries with 1 query for each day of the week. I'm trying to do something like:
Select item, date, customer, truck
If customer, item combo appears in multiple weeks
Please let me know if you have any idea how I can do this!
Aucun commentaire:
Enregistrer un commentaire