sql语句update通过另外的表更新本表数据为何不行啊???:
update s set s.qty=s.qty+b.qty
from stock s,person b
where s.per_no=b.per_no
and b.per_no='02';
update s set s.qty=s.qty+b.qty
from stock s,person b
where s.per_no=b.per_no
and b.per_no='02';
and b.per_no='02';)
update stock s set qty=qty+(select qty from person where s.per_no=per_no and per_no='02')merge into stock s using person b on(s.per_no=b.per_no and b.per_no='02')
when matched then update set s.qty=s.qty+b.qty