News for hackers. Stuff that matters.
Re:PRQL – A proposal for a better SQL by correct-me-plz on Monday January 24, 2022 @03:38PM (#30063677)
Snowflake lets you refer to column aliases, and it's great!

There's the slight issue of shadowing of table column names, which they resolve by preferring columns to aliases if both are named the same. So sometimes my aliases end up prefixed with underscores, but that's not a big deal.

Re:PRQL – A proposal for a better SQL by twoodfin on Monday January 24, 2022 @06:58PM (#30065927)
The trade-off is that a schema change (adding a column) unrelated to your query can modify its behavior.

Favoring aliases over columns instead has the potential to introduce irresolvable ambiguities as you can’t “qualify” a column alias with a SELECT list or subquery ID the way you can qualify a column by its table/view alias.