oracle - ORA-00905: missing keyword during merge in sql -
good afternoon,
this statement works...
merge temp using(select * emp deptno=10) s on (temp.empno=s.empno) when matched update set temp.sal=s.sal*0.1 sal > 300 when not matched insert (temp.ename,temp.sal )values (s.ename,s.sal*0.1) (s.sal<300);
but when trying utilize next merge command. ending missing keyword error
sql> **merge temp using (select * emp deptno=10) on (1=1);**
i created temp construction similar emp table
can please help me out. want re-create content emp table temp table where deptno=10
using merge command
merge temp target using (select * emp deptno=10) source on (target.empid = source.empid) when matched update set target.sal=source.sal*0.1;
you cannot utilize on (1=1) merge because merge deterministic.
merge deterministic statement. cannot update same row of target table multiple times in same merge statement.
however, it's not true insert. may utilize on (1=0) illustration insert whatever want.
sql oracle
No comments:
Post a Comment