Brackets do not change semantics. The ON clause position controls the logical order of joins.
First request
SELECT Customer.Name, Product.Desc, Transaction.Date FROM Product INNER JOIN Transaction ON Transaction.ProductID = Product.ID INNER JOIN Customer ON Transaction.CustomerID = Customer.ID
Second request
(backup brackets removed)
SELECT Customer.Name, Product.Desc, Transaction.Date FROM Product INNER JOIN Transaction INNER JOIN Customer ON Transaction.CustomerID = Customer.ID ON Transaction.ProductID = Product.ID
So, logically, in the first example, the connection on Transaction, Product first occurs, then the virtual table obtained from this connects to Customer , while in your second example, the connection on Transaction, Customer Product first connects to the virtual table obtained from this, connects to Product
This is only logical, and since internal joins are associative and commutative, it probably won't make any difference to the execution plan (unless you add OPTION (FORCE ORDER) to the query), but it can do for external joins.
This is covered by Itzik Ben Gan here , but there are a number of inaccuracies in the article, see the subsequent letter from Lubor Kollar .
source share