3 ms·
`group by 1` is actually allowed in several SQL implementations, and there's no reason it can't be -- the same as with column aliases the db engine can just rew
by jvns 7y ago
`group by 1` is actually allowed in several SQL implementations, and there's no reason it can't be -- the same as with column aliases the db engine can just rewrite
select name, count(*) from table group by 1
as
select name, count(*) from table group by name
before executing the query
- erik_seaberg 7y agoI will never forget Percona telling us ORDER BY NULL would defeat something MySQL was getting wrong in a query that already wasn't ordered by anything. A coworker put it as "waving a dead chicken that doesn't even exist".