← Back to context

Comment by rixed

4 years ago

> Unnecessary repetition — the calculations for each measure are repeated, despite deriving from a previous measure. The repetition in the WHERE clause obfuscates the meaning of the expression

In my own in-house SQL-like language I solve this simple issue by allowing previously defined columns to be reused:

  select
    salary + payroll_tax as _gross_salary,
    _gross_salary + benefits_cost as gross_cost,
    ...etc...

the prefixing underscore meaning those columns are just temps excluded from the output.

I do not believe other issues are actually issues, and am quite surprised by the volume of interest for this SQL alternative. Can't be because rust is mentioned, can it?