Home » SQL & PL/SQL » SQL & PL/SQL » ORA-00979: not a GROUP BY expression
ORA-00979: not a GROUP BY expression [message #23034] Wed, 13 November 2002 13:15 Go to next message
Muthu
Messages: 58
Registered: August 2000
Member
Query
-----
SELECT
(EMP.EMP_NAME) ,
TO_NUMBER(TO_CHAR(DEPT.HIRE_DATE,'YYYY'))
FROM
EMP,
DEPT
WHERE ( EMP.ID=DEPT.ID )
Group BY
EMP.EMP_NAME,
TO_NUMBER(TO_CHAR(DEPT.HIRE_DATE,'YYYY'))
------------------------------------------
I was trying to run this query in my production database and i was getting ORA-00979: not a GROUP BY expression at line number 3 which is the date field.
Interesting thing is same query is working fine in Development server which is the identical database. I checked the data type under that table on both the environments which is the same of DATE type.
Also if i remove the Group By clause, the query is working so i am sure there is no syntax error in
TO_NUMBER(TO_CHAR(DEPT.HIRE_DATE,'YYYY'))

I really don't know what is happening. Can anyone explain why the same query is working in one database and not on the other (the databases are identical with version, release..etc.)

Please help!!!!
Re: ORA-00979: not a GROUP BY expression [message #23035 is a reply to message #23034] Wed, 13 November 2002 13:25 Go to previous messageGo to next message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
Do you get this error if you run this exact query in SQL*Plus? I don't see anything in this query that would cause that particular error.

Can you cut and paste your SQL*Plus session that shows the error?
Re: ORA-00979: not a GROUP BY expression [message #23048 is a reply to message #23034] Thu, 14 November 2002 07:47 Go to previous messageGo to next message
Muthu
Messages: 58
Registered: August 2000
Member
I have a base server version of 8.1.7.0 and applied a patch 8.1.7.1 on top of it. This is the same in development, QA and production.
Re: ORA-00979: not a GROUP BY expression [message #23051 is a reply to message #23034] Thu, 14 November 2002 11:47 Go to previous messageGo to next message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
I don't know what else to suggest at this point except that you upgrade to the latest 8.1.7 version which is 8.1.7.4.
Re: ORA-00979: not a GROUP BY expression [message #23100 is a reply to message #23051] Mon, 18 November 2002 10:35 Go to previous message
Muthu
Messages: 58
Registered: August 2000
Member
I understand. But i cannot upgrade as my application needs 8.1.7.1. But interesting why does it work in Development database which is the same version and i built the production based on Dev only.
I hope i will troubleshoot more. If you have anything which you could think of, please let me know.

thanks,
Previous Topic: analyze command
Next Topic: View functions and procedures
Goto Forum:
  


Current Time: Mon Apr 29 11:11:07 CDT 2024