朋友们,我正在使用合并语法来更新和插入表中的值
MERGE INTO iq_dnr b
USING (SELECT *
FROM iq_dnr
WHERE co_series = 'IO' AND CATEGORY = 9 AND dnr_from = 13567362) a
ON ( a.co_series = b.co_series
AND a.CATEGORY = b.CATEGORY
AND a.dnr_from = b.dnr_from)
WHEN MATCHED THEN
UPDATE
SET b.dnr_to = 0001
WHEN NOT MATCHED THEN
INSERT (co_series, CATEGORY, dnr_from, dnr_to)
VALUES ('IO', 9, 13567362, 00001)
我想问是否可以像我在上面的查询中那样只检查和插入一个表。知道问题是我能够成功更新表,但我无法插入值。请帮助我