我有这个查询:
Select To_Char(Order.Date, 'IW') As "Week No",
Order.User As "User",
Count(Order.OrderNo) As "Total Orders",
Sum(Order_Totals.Qty) As "Total Items",
From Order Order,
Order_Totals Order_Totals
Where Order.OrderNo = Order_Totals.OrderNo
And (Order.Date Between '01-JAN-15' And '31-DEC-15')
Group By Order.User
但它抛出错误信息:
Not a valid GROUP BY expression
我想显示今年每个用户每周创建了多少订单和项目,查看http://www.techonthenet.com/oracle/group_by.php我认为我使用GROUP BY
正确,但显然不是,我不是确定我该如何排序。
您也必须添加
To_Char(Order.Date, 'IW')
。GROUP BY