我有以下DB2代码,其中列出了一些我需要删除的重复错误行。任何人都可以帮助将其变成删除声明吗?
with AN as (select AN
from SCHEMA1.ACCR
where TIME = '2013-06-01')
select *
from AN a
inner join SCHEMA1.ACCR b
on a.AN = b.AN
where TIME = '2012-06-01'
谢谢!
答案 0 :(得分:1)
这是我最终使用的:
DELETE
from SCHEMA1.ACCR b
WHERE AN IN (select AN from SCHEMA1.ACCR where TIME='2013-06-01')
AND TIME'2012-06-01'
感谢您提出问题/建议。
答案 1 :(得分:0)
with AN
as (select AN
from SCHEMA1.ACCR
where TIME='2013-06-01')
delete b
from AN a
inner join SCHEMA1.ACCR b
on a.AN=b.AN
where TIME='2012-06-01'