0

我有以下 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'

谢谢!

4

2 回答 2

1

这就是我最终使用的:

DELETE
from SCHEMA1.ACCR b 
WHERE AN IN  (select AN from SCHEMA1.ACCR where TIME='2013-06-01') 
AND TIME'2012-06-01'

感谢您的问题/建议。

于 2013-07-03T16:11:18.757 回答
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'
于 2013-07-02T20:55:29.157 回答