Mysql – Sum Case between relative dates
I'm triying to add quantities of fuels from two tables. Payments table contains data about customers and dates. Fuels table contains data about fuels recharged. I need to add the litres by customer in 3 groups: from yesterday until 46…