id name price
1 A 100
2 B 200
3 C 300
上面是我获取的记录集,然后我想调用里面的字段price,乘一个固定值,然后将所有数据插入另外一个表
如
id int
name var(10)
index int -- 行数
oldprice --旧的
newprice --新的能不能insert into 表 values (...)做循环添加进去呢?
1 A 100
2 B 200
3 C 300
上面是我获取的记录集,然后我想调用里面的字段price,乘一个固定值,然后将所有数据插入另外一个表
如
id int
name var(10)
index int -- 行数
oldprice --旧的
newprice --新的能不能insert into 表 values (...)做循环添加进去呢?
select id,name,price,price*0.2 into newtable from tb
select id,name,row_number(order by getdate()),price,price*固定值 from 表1