1.列子:sql server中更新scores表中的Sname等于从students表中Sname
select * from scores;
select * from students;
更新scores表中的Sname等于从students表中Sname
select 'update scores set SName='''+t.Sname+''' where SId='+s.SId +';' updateSqwl
from(
select a.SId,a.Sname
from students a
)t
inner join scoreS s on t.SId=s.SID;
赋值出来执行就达到效果了
select * from scores;
2018.08.13 我同事跟我说的