回答

收藏

更新另一个表中的数据

技术问答 技术问答 241 人阅读 | 0 人回复 | 2023-09-12

我需要在另一个表中更新一些数据。' P, Q9 s7 a! a4 J' q
我只想简单地将数据从表1数据col1到表2的col1.行位于同一位置,所以没有必要做任何事情ID比较工作。& _% n- Z" g* i
我怎样才能做到这一点?0 L* J2 N0 s& o; n7 `
-----------------------------------------Db1.Table1 (Take yearModel from this table to update Table3)-----------------------------------------imgid          | int | PK |yearModel      | int |----------------------------------------------------------------------------------Db2.Table2 (Go by this table to update Table3)-----------------------------------------imgid          | int | PK |uploadId       | int | FK (With table3.uploadId) |------------------------------------------------------------------------------------Db2.Table3 (Update this table with the yearModel from table1)-------------------------------------------uploadId        | int | PK |uploadYearModel | int |对不起,我的数据库diagaram“ thingy因一些奇怪的原因而崩溃。
! B/ w# j3 X& M$ V' }我也应该提到Table1位于另一个数据库中。我不确定这是否重要..但是很好.. % O  v0 S" P/ V
提前致谢!% g6 q9 g% G5 E+ T" _
                                                                ! A- V" ^5 a( k" x/ g" ^4 g
    解决方案:
分享到:
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则