如果
table_2为空,请尝试以下插入语句:
insert into table_2 (itemid,location1) select itemid,quantity from table_1 where locationid=1
如果
table_2已经包含
itemid值,请尝试以下更新语句:
update table_2 set location1=(select quantity from table_1 where locationid=1 and table_1.itemid = table_2.itemid)



