在 SQLite 版本 3.7.12.1(控制台)中,此查询不起作用:
(SELECT * FROM A
UNION
SELECT * FROM B)
EXCEPT
(SELECT * FROM A
INTERSECT
SELECT * FROM B);
错误信息
错误:第 1 行附近:“(”附近:语法错误
此查询适用于 SQL Server Management Studio。其他带括号的查询确实按预期工作。我错过了什么吗?
编辑:澄清:
SELECT * FROM A; <-- works
(SELECT * FROM A); <-- does not work [Error: near line 1: near "(": syntax error]
SELECT * FROM A WHERE A.id IN (SELECT B.id FROM B); <-- works, so no fundamental issues with brackets and sqlite...