Skip to content
Advertisement

Tag: database

Getting wrong sum when using group by with inner join

With reference to this question (How to get the sum in a joined table when using group by – getting wrong results) I have two tables orders and order_items. I need to group the results by days. But I also need to get the sum of energy_used for each day from another table. When I try that using a join,

Advertisement