互联网服务

这是DB2错误码sql20165n的BUG吗?

test1:--成功with t as(select * from old table (delete from taba))select c.col1,c.col2from t c join tabb d on c.col1 = d.col1--失败,报sql20165nselect c.col1,c.col2 from (select * from old table (delete from taba)) cjoin tabb d on c.col1 = d.col1 ;test2...显示全部

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里面怎么写也报这个错误!

收起
参与3

查看其它 1 个回答UniverseSae的回答

UniverseSaeUniverseSae数据库管理员待业
回复 2# jianghshun


   应该是我没有问清楚问题,我其实是想了解一下select * from ( ... ) 和 with t as(...)之间有什么区别!
互联网服务 · 2013-04-30
浏览655

回答者

UniverseSae
数据库管理员待业

UniverseSae 最近回答过的问题

回答状态

  • 发布时间:2013-04-30
  • 关注会员:1 人
  • 回答浏览:655
  • X社区推广