我正在查看 SQL 的语法,特别是字符串文字。
<character string literal> ::=
[ <introducer> <character set specification> ]
<quote> [ <character representation> ... ] <quote>
[ { <separator> <quote> [ <character representation> ... ] <quote> }... ]
忽略[ <introducer> <character set specification> ]
部分,这是否意味着一个或多个<quote> [ <character representation> ... ] <quote>
s 由 a 分隔<separator>
?
如果是这样,这是否意味着'hello' 'world'
应该将其解析为 one <character string literal>
?
对于查询SELECT 'hello' 'world'
,Microsoft SQL Server 2005 返回:
+-------+
| world |
+-------+
| hello |
+-------+
MySQL 5.0 返回:
+------------+
| hello |
+------------+
| helloworld |
+------------+
我知道每种 SQL 风格都是不同的,而且它们并不都遵循标准。我只是想确定我是否正确解释了 BNF。谢谢。