我正在查看SQL的语法,特别是character string literal。解释SQL的BNF
<character string literal> ::=
[ <introducer> <character set specification> ]
<quote> [ <character representation> ... ] <quote>
[ { <separator> <quote> [ <character representation> ... ] <quote> }... ]
忽略[ <introducer> <character set specification> ]
一部分,这意味着一个或多个由一个<separator>
分离<quote> [ <character representation> ... ] <quote>
S'
如果是这样,是否意味着'hello' 'world'
应该被解析为一个<character string literal>
?
对于查询SELECT 'hello' 'world'
,微软SQL Server 2005倍中的回报:
+-------+
| world |
+-------+
| hello |
+-------+
和MySQL 5.0返回:
+------------+
| hello |
+------------+
| helloworld |
+------------+
据我所知,SQL的每一种滋味是不同的,他们不全部遵循标准。我只是想确定我是否正确解释BNF。谢谢。
一个小布局点:SQL服务器返回列标题世界的值“hello”。 “世界”被解释为别名/标识符。好的问题... – gbn 2010-10-26 19:10:43