SQL SELECT/GROUP BY Syntax
Discussions center on SQL query syntax improvements, including flexible SELECT and GROUP BY behaviors, automatic grouping of non-aggregated columns, FROM-first syntax, and features in databases like DuckDB, Postgres, and PRQL.
Activity Over Time
Top Contributors
Keywords
Sample Comments
Absolutely cannot wait for this to come to SQL. Or is there a way already to adopt this?
Go further: `FROM users WHERE name LIKE 'a%' SELECT name, id, location` - after all, you can WHERE on things that aren't projected by SELECT
why would you do all this work when postgres sorted this all out over a decade ago?
Some DBs let you do this and it's helpful when one of the things you're selecting is some complex scalar expression, but you still have to list each item in the group by
Because of things like WHERE/HAVING in SQL.
Wow, i'm struggling with a sql query in psql just right now, this seems to be just what i was looking for! Thank you so much!
I like the "WHERE 1" trick, thanks!
Don't get ahead of yourself: it's SELECT with GROUP BY.
Yea sorry, unfortunately not something the SQL library I used supports, select * is the best for now but I'm adding "table preview" to the list for future updates!
How about nested selection ? SQL is dump because it doesn't allow nested selection by default.