I'm just learning about joins. Anyway I've found this example in a book which has square brackets around the name of a table used. I don't think the name of the table is a reserved word. Does anyone know why the square brackets were used? :-
SELECT Customers.CustomerID, Customers.CompanyName
INNER JOIN Orders
ON Customers.CustomerID = Orders.CustomerID)
INNER JOIN [Orders Details]
ON Orders.OrderID = [Order Details].OrderID
I think I've just worked it out that the square bracked are needed because there is a space character in the table name.
But while we're on the subject would anyone be able to tell me how to work out where the best place is to put the enclosing brackets. For example, if another JOIN was to be used how would you know where to put the brackets so that he code looks as neat as
p.s. The book example is from a book called MS SQL Server 2005 Express in 24 Hours by Alison Balter.
View Complete Post