The merge into base @ TB b
Using MainRelation c
On (b.e jycode=c.e jycode)
The when matched then
The update
Set the if (c.l ecode & lt;> "' and c.l ecode is not null) then b.l ecode=c.l ecode,
If (c.l ename & lt;> "' and c.l ename is not null) then b.l ename:=c.l ename,
If (Arthur c. reated_date & lt;> "' and Arthur c. reated_date is not null) then biggest reated_date:=Arthur c. reated_date,
If (c.u pdate_date & lt;> "' and c.u pdate_date is not null) then b.u pdated_date:=c.u pdate_date,
If (c.f lag & lt;> "' and c.f lag is not null) then b. lag=c.f lag
When not matched then
Insert
Values
(c.e jycode,
C.l ecode,
C.l ename,
Arthur c. reated_date,
C.u pdate_date,
C.f lag);
CodePudding user response:
Set the if (c.l ecode & lt;> "' and c.l ecode is not null) then b.l ecode=c.l ecode,
- try to this, the condition was established, the update for the new value, was not, then update to the original value (indirect achieve the purpose of not update -)
The set b.l ecode=case when c.l ecode & lt;> "' and c.l ecode is not null then c.l ecode else b.l ecode end
CodePudding user response:
The updateSet the if (c.l ecode & lt;> "' and c.l ecode is not null) then b.l ecode=c.l ecode
Rewrite into
The update
Set n b.l ecode=decode (c.l ecode, ' ', b.l ecode, c.l ecode)
CodePudding user response: