What does SQL clause "GROUP BY 1" mean?
It means to group by the first column of your result set regardless of what it's called. You can do the same with ORDER BY
.
SELECT account_id, open_emp_id
^^^^ ^^^^
1 2
FROM account
GROUP BY 1;
In above query GROUP BY 1
refers to the first column in select statement
which is
account_id
.
You also can specify in ORDER BY
.
Note : The number in ORDER BY and GROUP BY always start with 1 not with 0.