Home » SQL & PL/SQL » SQL & PL/SQL » ORA-00937: not a single-group group function (Oracle 10g)
ORA-00937: not a single-group group function [message #344590] Sat, 30 August 2008 17:17 Go to next message
joey05in
Messages: 1
Registered: August 2008
Junior Member
I execute the following query
select sum(shipment.vc_shipment_price),
ord.uc_company,
ord.uc_division
from trlr,
car_move,
stop,
shipment,
shipment_line,
ord_line,
ord
where trlr.trlr_cod = 'SHIP'
and trlr.trlr_id = car_move.trlr_id
and car_move.car_move_id = stop.car_move_id
and stop.stop_id = shipment.stop_id
and shipment.ship_id = shipment_line.ship_id
and shipment_line.ordnum = ord_line.ordnum
and ord_line.ordnum = ord.ordnum
and shipment.shpsts in ('D', 'L', 'S')
and shipment.stgdte >= sysdate
or shipment.loddte >= sysdate
order by ord.uc_company, ord.uc_division

and I get this error
ORA-00937: not a single-group group function

I am new to oracle. Please suggest what change I have to make to my query work..

[Updated on: Sat, 30 August 2008 17:19]

Report message to a moderator

Re: ORA-00937: not a single-group group function [message #344593 is a reply to message #344590] Sat, 30 August 2008 20:18 Go to previous message
BlackSwan
Messages: 25046
Registered: January 2009
Location: SoCal
Senior Member
http://www.orafaq.com/forum/t/88153/0/
Please read & FOLLOW the Posting Guidelines as stated in URL above

You need a GROUP BY clause

Why do you have 7 tables in the FROM clause,
when data in the SELECT clause comes FROM only 2 tables?

The other 5 tables should be eliminated out of the FROM clause
& if these 5 tables are required for filtering they should be subordinated into the WHERE clause.

The whole Oracle Doc. set can be found at http://tahiti.oracle.com

SQL is not something you learn by trial & error.

http://www.amazon.com/gp/offer-listing/0764577557/ref=pd_bbs_sr_olp_4?ie=UTF8&s=books&qid=1220145403&sr=8-4

[Updated on: Sat, 30 August 2008 20:39] by Moderator

Report message to a moderator

Previous Topic: How to improve select coun(*) from table
Next Topic: ROW NUM
Goto Forum:
  


Current Time: Thu Dec 08 08:31:08 CST 2016

Total time taken to generate the page: 0.15020 seconds