top | item 47124591

(no title)

jelder | 7 days ago

DuckDB had the right idea: just allow some flexibility in the relative order of the `select` and `from` clauses, and make a few other concessions for ergonomics. This then becomes valid:

    from events      -- table is first, which enables autocomplete
    select
        count(),     -- * is implied, easier to type
        customer_id, -- trailing commas allowed everywhere
    group by all     -- automatically groups by all non-aggregate columns
    order by all     -- orders rows by all columns in selected order
https://duckdb.org/docs/stable/sql/dialect/friendly_sql

discuss

order

andrew_lettuce|7 days ago

I get the ease of use - and sometimes use them myself- but implied (or relative) shortcuts are IMO a bad habit that can lead to serious issues that don't manifest as errors. I do like the from clause first which better matches the underlying relationship algebra!