Oracle - 错误除外
有很少的列和表,如下所示:
注意:所使用的元素名称仅用于说明目的。
SELECT T.col1
FROM Table1 T
WHERE NOT EXISTS (
(SELECT * FROM Table2)
EXCEPT (SELECT TT.col1
FROM TableTT TT
WHERE TT.col2 = T.col2)
);
错误:缺少右括号,尽管括号看起来匹配。
但是,我确实知道它实际上与括号无关。我怀疑错误出现在 EXCEPT 子句中。可能是什么导致了错误?
Have few columns and tables, as follows:
NOTE: The names of elements used are for illustrative purposes only.
SELECT T.col1
FROM Table1 T
WHERE NOT EXISTS (
(SELECT * FROM Table2)
EXCEPT (SELECT TT.col1
FROM TableTT TT
WHERE TT.col2 = T.col2)
);
Error: Missing right parenthesis, though the parentheses seem to match.
But, I do know that it has nothing to do with the parenthesis actually. And I suspect the error to be somewhere in the EXCEPT clause. What might have resulted in the error?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Oracle 中没有
EXCEPT
运算符。请改用MINUS
。参考:此处在您的查询中,单词“EXCEPT”是最有可能被视为
(SELECT * FROM Table2)
子查询的表别名。更新:
提供的数据结构的完整查询如下所示:
请注意,我已将
Table2
的*
更改为col1
- 如果您从TT
中选择单个 INT 列TT.col1
,那么您还应该从Table2
中选择单个 INT 列。There's no
EXCEPT
operator in Oracle. UseMINUS
instead. Reference: HereIn your query the word 'EXCEPT' is most probably treated as a table alias for
(SELECT * FROM Table2)
subquery.UPDATE:
Full query for provided data structure will look like:
Note that I have changed
*
tocol1
forTable2
- if you're selecting single INT columnTT.col1
fromTT
then you should also select single INT column fromTable2
.