select * from TB1 where id='A' 的数据会出来N条 现在想把查询出来的信息 插入另外一个一表 id 变成‘B’
number 字段的值变成 原来的 80%, 这个存储过程该怎么写。
------解决思路----------------------
create proc usp_updateA
as
begin
select * into #tempA from TB1 where id='A' --1、建立临时表
update #tempA set id='B',number=number*0.80 --2、处理更新值
insert into TB2 --3、放入新表
select * from #tempA
end