O'Reilly logo
  • Dustin Waybright thinks this is interesting:

SELECT S.companyname AS supplier, S.country, P.productid, P.productname, P.unitprice, C.categoryname FROM Production.Suppliers AS S LEFT OUTER JOIN (Production.Products AS P INNER JOIN Production.Categories AS C ON C.categoryid = P.categoryid) ON S.supplierid = P.supplierid WHERE S.country = N'Japan';


Cover of Training Kit (Exam 70-461): Querying Microsoft® SQL Server® 2012


Example of enclosing an INNER JOIN in parenthesis to keep only those records with a category before adding to the OUTER JOIN that is preserving all customers.