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...