我想从TARGET_TABLE中删除记录,这些记录在SOURCE_TABLE中没有对应的记录。在Postgres中,以下内容显然适用,而在Oracle中则不行:
MERGE INTO TARGET_TABLE tar
USING (select s.empno from SOURCE_TABLE s
left outer join TARGET_TABLE t
on s.empno=t.empno
where t.empno is null) src ON (tar.empno = src.empno)
WHEN NOT MATCHED THEN DELETE
在Oracle中使用MERGE时是否可以执行DELETE作为唯一动作?
答案 0 :(得分:0)
根据oracle文档,您不能这样做
但是您可以使用虚拟更新
queryset = Product.objects.filter(category=2)
for i in queryset:
for j in Windows_system_apps:
if i.name in j:
i.app_type = 1
i.save()
pattern = ["alpha123", "delta1", ... ]