我想每天查看营业额摘要。
这是 mySQL 查询:
SELECT
o.date_purchased,
round(ot.value,2)
FROM orders o
JOIN orders_total ot ON ot.orders_id = o.orders_id
WHERE o.date_purchased <= '2012-05-12'
AND o.date_purchased >= '2012-04-12'
AND ot.class = 'ot_total'
结果,我收到了 10 个带有购买日期的订单。但我也会得到没有营业额期间的天数,比如这个例子: 2012-04-12 0,00 2012-04-13 120,95 2012-04-14 0,00
格雷茨罗恩