尝试这样做(在 SQL Server 中工作):
WITH X AS (), Y AS (), Z AS ()
DELETE FROM TBL
WHERE TBL.ID IN (SELECT ID FROM Z);
这适用于甲骨文:
WITH X AS (), Y AS (), Z AS ()
SELECT * FROM TBL
WHERE TBL.ID IN (SELECT ID FROM Z);
但 DELETE 没有:ORA-00928: missing SELECT 关键字
我的子查询相当大,是否有不同的语法可以让它工作?