I don't understand a FROM clause with ON in an unexpected place

Viewed 78

I have inherited a query. It is the product of some query designer. The form of the query is:

select stuff
    from a
        join b
        join c on b.k = c.k
        join d on c.j = d.j
        on a.l = d.l
            and a.m = d.m
        join e on a.n = e.n

I expect a join to be join t1 on t1.f = t0.f, like the second, third, and fourth lines with 'join'. I don't know how I am supposed to read this query with a table that doesn't have a 'on' right after it, and later, two 'on's in a row.

But server doesn't mind. It returns a data set of stuff that has served us well, until now when we want to change the stuff we are selecting. How is the server parsing this?

TIA

2 Answers
Related