I need in one SQL count by two different group:
by order_id from ORDERS table and item_id from order_items.
I have the folloing SQL:
SELECT O.ACCOUNT_ID, O.SHIP_DATE,
count(O.ORDER_ID) ,
COUNT(I.ITEM_ID) over (partition by COUNT(O.ORDER_ID) ) LINE_ITEMS
FROM orders o, order_items i
WHERE orders.order_id = order_items.order_id
and o.ship_date ='05-AUG-02'
and o.account_id in (1,36,11)
GROUP BY O.ACCOUNT_ID, O.SHIP_DATE
ERROR at line 5:
ORA-00979: not a GROUP BY expression
Please help.
Thanks.
by order_id from ORDERS table and item_id from order_items.
I have the folloing SQL:
SELECT O.ACCOUNT_ID, O.SHIP_DATE,
count(O.ORDER_ID) ,
COUNT(I.ITEM_ID) over (partition by COUNT(O.ORDER_ID) ) LINE_ITEMS
FROM orders o, order_items i
WHERE orders.order_id = order_items.order_id
and o.ship_date ='05-AUG-02'
and o.account_id in (1,36,11)
GROUP BY O.ACCOUNT_ID, O.SHIP_DATE
ERROR at line 5:
ORA-00979: not a GROUP BY expression
Please help.
Thanks.