Hacker News new | ask | show | jobs
by jhallenworld 2075 days ago
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)