SELECT
dm.DISTRICT_NAME ,
od.REGULAR_WORKERS_COUNT,
od.DAILY_OR_CASUAL_WORKERS_COUNT,
od.CONTRACT_WORKERS_COUNT,
od.TOTAL_COUNT
FROM
ORG_DETAILS od with (NOLOCK)
INNER JOIN
DISTRICT_MASTER dm with (NOLOCK) ON od.DISTRICT_ID = dm.DISTRICT_ID
GROUP BY
dm.district_name
I had this code, and I am looking to group my table with district_name. I am getting an error though.
Error message :
Column 'ORG_DETAILS.REGULAR_WORKERS_COUNT' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.