2 ms·
Ideally, it needs to be "from", then arbitrary number of something like `let` statements that can introduce new variables, maybe interspersed with where-s, and
by cyberax 1y ago
Ideally, it needs to be "from", then arbitrary number of something like `let` statements that can introduce new variables, maybe interspersed with where-s, and then finally "select".
"select" can also be replaced with annotations, something like: `from table_1 t1 let t1.column_1 as @output_1 where ...` and then just collect all the @-annotated variables.
I need to write a lot of SQL, and it's so clumsy. Every time I need a CTE, I have to look into the documentation for the exact syntax.
- 1718627440 1y ago> Ideally, it needs to be "from", then arbitrary number of something like `let` statements Isn't that what a CTE is?
- tracker1 1y agoThat was kind of my first thought...
- cryptonector 1y agoNot quite. u/cyberax wants scalar bindings, not table-valued bindings. Something like FROM foo LET a = (x + y) * z SELECT a; whereas CTEs are... Common Table Expressions.