我有这样的查询:
DELETE FROM db2inst1.REPORTER_STATUS INNER JOIN REPORTER_DETAILS
ON REPORTER_STATUS.SERVERSERIAL = REPORTER_DETAILS.SERVERSERIAL
AND year(REPORTER_STATUS.FIRSTOCCURRENCE)=2011 AND
month(REPORTER_STATUS.FIRSTOCCURRENCE)=12 AND
day(REPORTER_STATUS.FIRSTOCCURRENCE)=12
我想运行像tihs这样的查询,但它给了我错误。我该如何运行这样的查询?
答案 0 :(得分:2)
不确定在DB2中是否允许使用已发布的删除形式(DELETE
和JOINS
),但您可以尝试执行以下操作
DELETE FROM REPORTER_STATUS
WHERE year(REPORTER_STATUS.FIRSTOCCURRENCE)=2011
AND month(REPORTER_STATUS.FIRSTOCCURRENCE)=12
AND day(REPORTER_STATUS.FIRSTOCCURRENCE)=12
AND SERVERSERIAL in
(
SELECT distinct SERVERSERIAL from REPORTER_DETAILS
)