test1:
--成功
with t as(select * from old table (delete from taba))
select c.col1,c.col2
from t c join tabb d on c.col1 = d.col1
--失败,报sql20165n
select c.col1,c.col2 from (select * from old table (delete from taba)) c
join tabb d on c.col1 = d.col1 ;
test2:
--成功
with t as (select * from old table (delete from taba))
select * from t;
--失败,报sql20165n
select * from (select * from old table (delete from taba))
--环境:
G:UsersAdministrator>db2level
DB21085I 实例 "DB2" 使用 "64" 位和 DB2 代码发行版 "SQL09074",级别标识为
"08050107"。
参考标记为 "DB2 v9.7.400.501"、"s110330" 和 "IP23238",修订包为 "4"。
产品使用 DB2 副本名 "DB2COPY1" 安装在 "D:PROGRA~2IBMSQLLIB" 中。
--------------
曾经在工作中试过在merge的using字句里面写update,并执行成功,当时忘记是什么版本,现在再在merge里面怎么写也报这个错误!