日期:2014-05-18 浏览次数:20381 次
insert into t2(name,pay1,pay2,pay3) select name,pay1*100*0.5,pay2*200*0.5,pay3*300*0.5 from t1
------解决方案--------------------
oracle的话
insert into t2(name,pay1,pay2,pay3)
select name,pay1*100*0.5,pay2*200*0.5,pay3*300*0.5 from t1 where rownum<=100
sqlserver
insert into t2(name,pay1,pay2,pay3)
select top 100 name,pay1*100*0.5,pay2*200*0.5,pay3*300*0.5 from t1
------解决方案--------------------
insert into t2(name,pay1,pay2,pay3) select name, pay1*100*0.5 as pay1_1, pay2*200*0.5 as pay2_2, pay3*300*0.5 as pay3_3 from t1