Using multiple JOINS. SUM() producing wrong value

前端 未结 2 1967
野趣味
野趣味 2020-12-15 11:28

I am getting some basic invoice information in a SQL query and figuring the Order Total and Payment Totals in the same query. Here is what I have thus far:

S         


        
2条回答
  •  北荒
    北荒 (楼主)
    2020-12-15 12:12

    my guess is that the payment is $10 and there are two items in the order (orderitems table). if that's the case, try using a GROUP BY on the orders/customers/orderstatus fields.

提交回复
热议问题