Reputation: 344
In MySQL, is it allowed to use space b/w table name, dot, and field name?
e.g., tableName . fieldName
?
Is it allowed in other SQLs?
Upvotes: 0
Views: 394
Reputation: 425033
Whitespace is officially allowed by the sql standard, and MySQL (and all databases AFAIK) allow whitespace in this situation.
That said, I have lost an hour or so of my life due to MySQL's quirky whitespace requirements in other places, for example:
Space required after --
for a comment (not SQL standard):
-- A comment
--A Syntax error (but a comment in other databases)
And this insidious implementation:
CAST(something as sometype) -- OK
CAST (something as sometype) -- syntax error
And I'm quite sure there are more surprises lurking.
Upvotes: 3