Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

not a GROUP BY expression

Status
Not open for further replies.

Ravala

Programmer
Jan 28, 2004
88
US
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top