我想从连接构造中删除,我必须为其提供别名(“映射”),因为最后我还必须在连接上使用 EXISTS 子句。所以整个事情看起来像这样:
DELETE a
FROM (TableA a INNER JOIN
(SELECT * FROM TableX x INNER JOIN TableY y ON x.id = y.id) map
ON a.key = map.key) mapped
WHERE EXISTS
(SELECT *
FROM LookUp l
WHERE l.key1 = mapped.TableAKey
AND l.key2 = mapped.TableXKey
AND l.key3 = mapped.TableYKey)
问题似乎与括号有关,因为我收到一个错误:
Incorrect syntax near 'mapped'.
任何帮助,将不胜感激。