Home > database >  Of the new turn
Of the new turn

Time:11-01

Two data structures are exactly the same, different database name. A, B, have the same watch to transact
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 
- 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;
='2020-08-31'
  • Related