Gossamer Forum
Home : General : Databases and SQL :

"not a GROUP BY expression"

Quote Reply
"not a GROUP BY expression"
I cannot run the following query

<--------------------------------------------------------------->

SELECT project_consultant.p_id, SUM(total_hours) Total, project_name, client_name, c_last, c_first, total_hours
FROM consultant, client, project, project_consultant
WHERE consultant.c_id = project.mgr_id
AND client.client_id = project.client_id
AND project.p_id = project.p_id
AND project.p_id = project_consultant.p_id
AND consultant.c_id = project_consultant.c_id
GROUP BY project_consultant.p_id
/

<--------------------------------------------------------------->

It gives the following error

<--------------------------------------------------------------->

SELECT project_consultant.p_id, SUM(total_hours) Total, project_name, client_name, c_last, c_first,
*
ERROR at line 1:
ORA-00979: not a GROUP BY expression

<--------------------------------------------------------------->

To create the tables and insert the records which are required for this question, download this SQL script file.

Subject Author Views Date
Thread "not a GROUP BY expression" gskahlon79 21498 Jan 22, 2003, 6:01 PM
Post Re: [gskahlon79] "not a GROUP BY expression"
Alex 20915 Jan 23, 2003, 12:33 AM
Post Re: [gskahlon79] "not a GROUP BY expression"
Stealth 20904 Jan 23, 2003, 12:37 PM
Post Re: [gskahlon79] "not a GROUP BY expression"
anup123 20343 Mar 23, 2003, 1:10 PM