Column should be in group by clause

Last modified: Last modified: 18 September 2025

Reports columns that are not in the GROUP BY clause or inside an aggregate function call.

Example (Microsoft SQL Server):

If you run the SELECT query, you will receive an error because Microsoft SQL Server expects the b column in GROUP BY or used inside an aggregate function. The following two examples will fix the error.

Inspection ID: SqlShouldBeInGroupByInspection