language design - Is whitespace optional in SQL queries? -
i have noticed using either oracle or sqlite, queries valid
select*from(select a,max(b)i c group by a)where(a=1)or(i=2);
is “feature” of sql keywords or words of query need not surrounded whitespace? if so, why designed way? sql has been designed readable, seems form of obfuscation (particularly max(b)i
thing i
token serves alias).
sql-92 bnf grammar here explicitly states delimiters (bracket, whitespace, * etc) valid break tokens, makes white space
optional in various cases other delimiters break tokens.
this true not sqlite , oracle, mysql , sql server @ least (that work , have tested), since specified in language definition.
Comments
Post a Comment