ORA-00979: not a GROUP BY expression [message #23034] |
Wed, 13 November 2002 13:15 |
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 #23100 is a reply to message #23051] |
Mon, 18 November 2002 10:35 |
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,
|
|
|