对于下面提到的查询:
MERGE INTO bonuses D
USING (SELECT employee_id, salary, department_id FROM employees
WHERE department_id = 80) S
ON (D.employee_id = S.employee_id)
WHEN MATCHED THEN UPDATE SET D.bonus = D.bonus + S.salary*.01
DELETE WHERE (S.salary > 8000)
WHEN NOT MATCHED THEN INSERT (D.employee_id, D.bonus)
VALUES (S.employee_id, S.salary*.01)
WHERE (S.salary <= 8000);
我需要获取行的ID,以防该行已更新或插入,并且NULL包含该行已被删除。是否有可能实现同样的目标?基本上有一种方法可以知道特定行已被更新或使用MERGE查询插入了新行。