4 ms·
You can do that in PostgreSQL, but not according to the spec, apparently, and the PostgreSQL developers regret the feature. [0] (As someone who's spent a lot of
by benesch 6y ago
You can do that in PostgreSQL, but not according to the spec, apparently, and the PostgreSQL developers regret the feature. [0] (As someone who's spent a lot of time trying to simulate PostgreSQL's name resolution rules... it's reassuring to know that the rules are painful inside of PostgreSQL too.)
[0]: https://www.postgresql.org/message-id/7608.1259177709%40sss.pgh.pa.us https://www.postgresql.org/message-id/7608.1259177709%40sss....
- jamii 6y agoI never figured out why AS isn't allowed in the GROUP BY clause. It would be much simpler to implement `SELECT a1 FROM nums GROUP BY a+1 AS a1`.
- deleted 6y ago[deleted]