順序:spa
(今後處開始能夠使用select中指定的別名)
SELECT SUM(goods.number) FROM order LEFT JOIN goods on goods.order_id = order.id WHERE order.status=1 GROUP BY order.user_id HAVING order.add_time > '2019-08-27 00:00:00' ORDER BY goods.number desc