关联子查询Update语句更新数据
- 作者: 朝天R大象
- 来源: 51数据库
- 2022-08-17
--方法1: Update?Table1?set?c?=?(select?c?from?Table2?where?a?=?Table1.a)?where?c?is?null? --方法2: update??A set??newqiantity=B.qiantity from??A,B where??A.bnum=B.bnum? --方法3: update ????(select?A.bnum?,A.newqiantity,B.qiantity?from?A?left?join?B?on?A.bnum=B.bnum)?AS?C set?C.newqiantity?=?C.qiantity where?C.bnum?=XX?
推荐阅读
