Why are these statements valid [am Using SQL2008 R2]
Select* FROM TableName --UPDATE: this is not allowed in Oracle (10g)
and
Select *From TableName --UPDATE: this is allowed in Oracle (10g)
Now this
Select*From TableName --UPDATE: this is not allowed in Oracle (10g)
UPDATE: All three are allowed in SQL Server
I have known it this way Select * From TableName
The spaces are not required in these instances to recognize the distinct tokens of the statement.
In general, programming language parsers work by breaking text into distinct tokens. In SQL Server in this instance, the keyword search completes at “select” since you cannot have keywords with a
*. The*gets put into the next token.You can even do this (look no space). Ugly as it may be