Home » SQL & PL/SQL » SQL & PL/SQL » ORA-000979: not a GROUP BY expression
ORA-000979: not a GROUP BY expression [message #325924] Mon, 09 June 2008 09:23 Go to next message
chaituu
Messages: 115
Registered: June 2008
Senior Member
I am passing parameters to TOTAL_AMOUNT function in a package.the function waht it will do is it will
round off the amount.when i execute this query i am egtting below exception .

ORA-000979: not a GROUP BY expression

SELECT 
	UTILITIES_PKG.TOTAL_AMOUNT ((SELECT SUM(EII1.QTY) * EII1.PRICE 
                                         FROM 
                                         EMPLOYEE_ITEMS EII1
                                         WHERE
                                         EII1.EMP_ID=E.ID
                                          GROUP BY 
					   EII1.ID,
                                           EII1.PRICE
						) ,
                                           E.EMP_ID,
                                           E.EMPCUR_ID
                                            ) AMOUNT
 
				FROM EMPLOYEE E,
				EMPLOYEE_ITEMS EII
				  WHERE
				 EII1.EMP_ID=E.ID

[Updated on: Mon, 09 June 2008 09:25]

Report message to a moderator

Re: ORA-000979: not a GROUP BY expression [message #325928 is a reply to message #325924] Mon, 09 June 2008 10:19 Go to previous message
Michel Cadot
Messages: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
SELECT utiLities_pkg.Total_amount((SELECT   SUM(eii1.qty) * eii1.Price
                                   FROM     Employee_Items eii1
                                   WHERE    eii1.emp_Id = e.Id
                                   GROUP BY eii1.Id,
                                            eii1.Price),
                                  e.emp_Id,e.empCur_Id) Amount
FROM   Employee e,
       Employee_Items eii
WHERE  eii1.emp_Id = e.Id

I think it is a clear formatting than yours.
Where do you get this error? At which line and column?
I don't see any reason to get this error but maybe it is inside your procedure.
Use SQL*Plus and copy and paste your session.

By the way, I don't what is this but it is really awful and you can be sure you will have bad performances.

Regards
Michel

[Updated on: Mon, 09 June 2008 10:19]

Report message to a moderator

Previous Topic: How to disable implicit commit in Oracle
Next Topic: Ideal methodology to use to import data from a reporting tool like web trends into an oracle DB
Goto Forum:
  


Current Time: Tue Feb 11 12:37:43 CST 2025