Last active
August 23, 2018 14:42
-
-
Save x-yuri/0cfd472ca68505c8cf5ebd90841127bf to your computer and use it in GitHub Desktop.
ERROR: aggregate functions are not allowed in GROUP BY
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ psql db -c "select char_length(string_agg(legacy_id, ', ')) from products group by 1" | |
| ERROR: aggregate functions are not allowed in GROUP BY | |
| LINE 1: select char_length(string_agg(legacy_id, ', ')) from products... | |
| ^ | |
| $ psql db -c "select char_length(string_agg(legacy_id, ', ')) from products group by TRUE" | |
| char_length | |
| ------------- | |
| 15666 | |
| (1 row) | |
| $ psql --version | |
| psql (PostgreSQL) 10.5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment