When using the merge::= MERGE INTO ... USING subquery t_alias
it appears one must enclose the subquery in parenthesis like MERGE INTO ... USING (subquery) t_alias
. However, the Oracle SQL Language Reference documentation's syntax diagram for subquery::= appears to show that an optional path (via query_block) does not require parenthesis. That is the documentation appears to allow both versions.
例如:
以下内容无效,但根据文档是允许的。
MERGE INTO tblA A
USING SELECT col FROM tblB B -- ORA-00903 invalid table name and "SELECT" is highlighted.
ON (A.id = B.id)
...
以下是有效的(并且根据文档也是允许的)。
MERGE INTO tblA A
USING (SELECT col FROM tblB) B
ON (A.id = B.id)
...
According to How to Read Syntax Diagrams
如果语法图具有多个路径,则可以选择任何路径。
是否有《 Oracle SQL语言参考》文档错误?
提前致谢。