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
Messages: 1
Registered: August 2008
Junior Member
I execute the following query
select sum(shipment.vc_shipment_price),
from trlr,
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
Messages: 24964
Registered: January 2009
Location: SoCal
Senior Member
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.


[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 Oct 27 04:45:33 CDT 2016

Total time taken to generate the page: 0.06991 seconds