News for hackers. Stuff that matters.
Re:A Short Story About SQL’s Biggest Rival by boramalper on Friday October 09, 2020 @06:13PM (#24734956)
I would reorder round and square brackets, since I may want to filter on computed/created columns, and the ordering makes it clearer.
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)
Re:A Short Story About SQL’s Biggest Rival by a1369209993 on Friday October 09, 2020 @07:07PM (#24735331)
I'm not sure if you misunderstood them or I misunderstood you, but there's no legitimate reason you can't filter on computed columns as is:

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