我正在查看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