I have to convert an old query from the deprecated *= to the left join statement. I am not particularly familiar with the old operator, and I'm not sure if the query I'm trying to convert is badly written, or if that's the correct notation. I'll try to explain what I mean:
SELECT GivenName, Surname, OrderNumber
FROM Customers, SalesOrders
WHERE Customers.ID *= SalesOrders.CustomerID
and SalesOrders.OrderNumber = 1000 -- ???
Is OrderNumber = 1000 part of the left join? If OrderNumber is not part of the left join, then the use of the *= operator seems pointless.
Or, in other terms, which is the equivalent code:
SELECT GivenName, Surname, OrderNumber
FROM Customers LEFT JOIN SalesOrders
ON Customers.ID = SalesOrders.CustomerID
and SalesOrders.OrderNumber = 1000
or
SELECT GivenName, Surname, OrderNumber
FROM Customers LEFT JOIN SalesOrders
ON Customers.ID = SalesOrders.CustomerID
WHERE SalesOrders.OrderNumber = 1000
In the 2'nd query, the left join would again be pointless.