Table has trn_amt trn_id, trn_dt (date).
Now I want to have A library of trn_dt date less than or equal to 2020-08-31 trn_amt value, replace the B value of the same trn_amt trn_id in library,
CodePudding user response:
Such as online ~ ~ ~ ~ ~ ~ ~CodePudding user response:
- use A library trn_amt value to replace B library corresponding trn_amt value='2020-08-31'
- the premise: trn_id has uniqueness
The update
B
The set b.t rn_amt=a.t rn_amt
The from a. d. bo. Transact a, B.d. Bo transact b
Where a.t rn_id=b.t rn_id
And a.t rn_dt & lt;