Skip to content

Commit c22965d

Browse files
committed
Fix GROUP BY in show_departments() for PostgreSQL strictness
PostgreSQL requires all non-aggregated columns in GROUP BY clause, unlike MySQL which allows functional dependency. Add dept_name and manager to GROUP BY.
1 parent bf33f26 commit c22965d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

postgresql/objects.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ BEGIN
168168
dept_no, dept_name, manager, COUNT(*)
169169
FROM v_full_departments
170170
INNER JOIN department_people USING (dept_no)
171-
GROUP BY dept_no;
171+
GROUP BY dept_no, dept_name, manager;
172172

173173
DROP TABLE department_max_date;
174174
DROP TABLE department_people;

0 commit comments

Comments
 (0)