News for hackers. Stuff that matters.
Re:A Short Story About SQL’s Biggest Rival by jhallenworld on Friday October 09, 2020 @06:19PM (#24735009)
It's up to you (and the query optimizer can reorder), but you have to make sure the column is available when you use it. Broken up:

I had:

    a = employee(name == "Jones")    a has name, salary and age

    w = a[comp = salary / (age - 18)]   w has comp
You want:

    b = employee[name, comp = salary / (age - 18)]   b has name and comp

    w = b(name == "Jones" && comp > 500)   w has name and comp
In one line:

    w = employee[name, comp = salary / (age - 18)](name == "Jones" && comp > 500)

There are no comments on this comment yet.