• Hi Hugo,

    Writing a question to demonstrate the equivalence of SQL expressions is very brave, so well done for that. Small point: in the explanation you say, "the only way to rewrite the query is to reverse the table order", but this code expresses the same SQL semantic I think:

    SELECT

    e.Name,

    c.Name,

    o.OrderDate

    FROM dbo.Employees AS e

    LEFT JOIN

    (

    dbo.Orders AS o

    JOIN dbo.Customers AS c ON

    c.CustomerID = o.CustomerID

    ) ON

    e.EmployeeID = o.CustomerID

    AND o.OrderDate > DATEADD(MONTH, -4, CURRENT_TIMESTAMP)

    WHERE

    e.Position = 'SalesRep'

    Personally I find this layout easier to read than 'nested' ON clauses.