Sql oracle在更新中使用having
以下是我想做的:Sql oracle在更新中使用having,sql,oracle,Sql,Oracle,以下是我想做的: updated EXD set reflog = 'blah' where reflog = 'A0003' having count(*) = '0' ; 我只想在EXD完全不包含任何记录的情况下更新它。我该怎么做 谢谢这会起作用,但不确定它是否像您那样有意义 正在更新EXD表中的所有记录(如果记录不更新) 不存在reflog A0003 update EXD set reflog = 'blah' where NOT EXISTS (SELECT 1
updated EXD set reflog = 'blah' where reflog = 'A0003' having count(*) = '0' ;
我只想在EXD完全不包含任何记录的情况下更新它。我该怎么做
谢谢这会起作用,但不确定它是否像您那样有意义 正在更新EXD表中的所有记录(如果记录不更新) 不存在reflog A0003
update EXD
set reflog = 'blah'
where NOT EXISTS
(SELECT 1
FROM EXD x
where x.reflog = 'A0003')
如果表中没有记录,那不是插入吗?如何更新不存在的内容?也许您的意思是它不存在于联接表中?很抱歉,我不清楚,仅当select*from EXD where reflog='blah'返回0时record@user1058398-它没有返回任何记录,您会更新什么?或者您是指空值