我必须创建一个查询来获取过去5天内去往区域的订单百分比。 - 放置在区域商店上的平均每日订单总数(ProcessingStatus =已处理)
我创建了以下查询...请帮助我符合上述条件...
SELECT trunc(order_date) as Order_Date, COUNT(web_order_number) AS NoOfOrders,
SUM(order_total) AS daily_total, scr.STORE_CONFIGURATION_ID, scr.COUNTRY
FROM purchase_order po
INNER JOIN STORE_CONFIG_REFERENCE scr
ON po.STORE_CONFIGURATION_ID = scr.STORE_CONFIGURATION_ID
WHERE po.PROCESSING_STATUS = 'processed' and po.order_date >= trunc(sysdate - 4)
GROUP BY trunc(order_date) ORDER BY order_date ASC;
立即收到错误:ORA-00979: not a GROUP BY expression.
以及如何计算订单百分比