Comment by Blackthorn
1 year ago
FROM first would be nothing short of incredible. I can only hope that Postgres and others can find it within themselves to get together and standardize on such an extension!
1 year ago
FROM first would be nothing short of incredible. I can only hope that Postgres and others can find it within themselves to get together and standardize on such an extension!
This syntax looks a lot like PRQL. ClickHouse supports writing queries in PRQL dialect. Moreover, ClickHouse also supports Kusto dialect too.
https://clickhouse.com/docs/en/guides/developer/alternative-...
Yeap I didn't know DuckDB supported it already!
Being able to do SELECT FROM WHERE in any order and allowing multiple WHEREs and AGGREGATE etc, combined with supporting trailing commas, makes copy pasting templating and reusing and code-generating SQL so much easier.
...
A special keyword like HAVING prevents erros by typing in the wrong line.
How is OR done with this WHERES?
What’s group-by-all? Sounds like distinct?
It's different from distinct. Distinct just eliminates duplicates but does not group entries.
Suppose...
This is not solved by using distinct as you would not get the correct count.
Group By All allows you to write it a bit more compact...
1 reply →
Normally the SELECT has a bunch of columns to group by and a bunch of columns that are aggregates. Then, in the GROUP BY clause, you have to list all the columns to group by. The query compiler knows which they are, and polices you, making sure you got it right. All the GROUP BY ALL does is say 'the compiler knows, there's no need to list them all'. Very convenient.
BigQuery supports GROUP BY ALL and it really cleans up lots of queries. E.g.
(eh, except MySQL; my memory of MySQL is it will silently do ANY_VALUE() on any columns that aren't an explicit aggregate function but are not grouped; argh it was a long time ago)
1 reply →
What exactly is the history of having FROM be the second item, and not the first? Because FROM first seems more intuitive and actually the way you write out queries.
Really hope this takes off and gets more widespread adoption because I really want to stop doing:
into