I would also like to see "friendly" SQL syntaxes like what DuckDB offers, but I doubt they'd add it without an update to the standards themselves.
Example:
SELECT users.id, COUNT(*)
FROM users
JOIN orders ON AUTO
WHERE orders.created_at > NOW() - '7 day'::interval
GROUP BY ALL
This would only work if there was an obvious path to do the join. In this case, I'm imagining that the `orders` table might have a `user_id` column which is a foreign key into the `users` table.I think you are suggesting some sort of lookup based on the defined FK relation, but that would be confused by situations where tables have multiple FK relations, such as tables with values restricted by a lookup value table (or more than 1 such FK). Those are pretty common, so I could see the 'AUTO' feature breaking down quickly. I think that is why the NATURAL JOIN approach is taken and that basically does what I believe you are describing, provided the column naming is matched.
[0] https://www.postgresql.org/docs/15/queries-table-expressions...
[edit:spelling]
Example pulled from Google: https://sebhastian.com/natural-join-mysql/
https://www.postgresql.org/docs/7.2/queries-table-expression...
SELECT * EXCLUDE
SELECT * REPLACE
Column Aliases in WHERE / GROUP BY / HAVING
Struct Dot Notation
Function Aliases from Other Databases
are implemented in ClickHouse long before.