I have two tables. Jobs and Parts. One Job can have many parts.
I want to list all the jobs, and then a column showing the sum of parts for that job.
My code (in Firebird) is below. I just get error – Invalid expression in the select list (not contained in either an aggregate function or the GROUP BY clause).
Thank you.
SELECT J.ID, J.REF, J.CUST, J.DATEADDED, Sum(P.QTYREQ)
FROM JOBS J
Join PARTS P
on J.ID = P.JOBID
Group by J.ID
New contributor
Simon is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.