The condition on r.job is more naturally thought of as a join
condition than a where condition. (This is an inner join, so the
semantics are identical.)
Also, for clarity, swap the flight and job conditions round, so that
the ON clause is a series of r.thing = otherthing.
No functional change.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Reviewed-by: George Dunlap <George.Dunlap@citrix.com>
---
v3: Fix daft syntax error.
v2: New patch.
FROM flights f
JOIN jobs j USING (flight)
JOIN runvars r
- ON f.flight=r.flight
+ ON r.flight=f.flight
+ AND r.job=j.job
AND r.name=?
- WHERE j.job=r.job
- AND f.blessing=?
+ WHERE f.blessing=?
AND f.branch=?
AND j.job=?
AND r.val=?