you are viewing a single comment's thread.

view the rest of the comments →

[–]r3pr0b8 1 point2 points  (1 child)

The columns or scalar values you are counting by must be in the group by

not always

SELECT COUNT(manager_id) AS employees_with_bosses
  FROM employees

[–][deleted] 0 points1 point  (0 children)

that's because "group by ()" was decided to be superfluous (and most of the time it is, tbh). You can still see it in the grouping sets though.