Inspectopedia
 
2024.3

Column should be in group by clause

Warning
New
Last modified: 03 December 2024

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.