如何使用2 On子句进行内部联接,有点像这样


update table1 inner join
table2
on table1.part_no = table2.partno
on table1.part_des = table2.partdes
set table1.description = table2.description;
update table1 inner join
table2
on table1.part_no = table2.partno
and table1.part_des = table2.partdes
set table1.description = table2.description;

我想你想要and:

update table1 inner join
table2
on table1.part_no = table2.partno and
table1.part_des = table2.partdes
set table1.description = table2.description;

您也可以使用相关的子查询:

update table1
set description = (select table2.description
from table2
where table1.part_no = table2.partno and
table1.part_des = table2.partdes
);

最新更新