我有一个看起来像这样的查询:
SELECT PubKey, Title FROM Publication
UNION
SELECT NoteKey, Title, FROM Note
哪个工作正常。当我尝试向其中添加 EXIST 时,我的麻烦就开始了:
SELECT PubKey, Title FROM Publication
UNION
SELECT NoteKey, Title, FROM Note
WHERE EXISTS (SELECT * FROM UserPublication WHERE UserPublication.PubKey = Publication.PubKey)
这会引发此错误:无法绑定多部分标识符“PubKey”。
能不能换一种写法?