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.
<--------------------------------------------------------------->
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.