What are the parentheses on lines 5 and 11 for?
1 SELECT
2 s.name, s.ShirtDescription, c.Color,
3 z.Size, i.AvailableQTY, i.UnitPrice
4 FROM
5 (
6 test.ShirtInventory i
7 join test.Colors c ON
8 i.ColorID = c.id
9 join test.Shirts s ON
10 i.ShirtID = s.ID
11 )
12 JOIN test.Sizes z ON
13 i.SizeID = z.ID
14 WHERE .....
I've never seen parentheses used this way in the FROM Clause. This isn't a sub query, and it's not scoping the the table and the joins. You can see where I reference i.SizeID outside the parentheses. When I first saw it, I thought it might be a way to "hint" to SQL Server how you wanted the data to be fetched, but nothing changes in the execution plan when you remove the parens.
Look forward to your replies. edit: got the lines wrong