34,652
社区成员
![](https://csdnimg.cn/release/cmsfe/public/img/topic.427195d5.png)
![](https://csdnimg.cn/release/cmsfe/public/img/me.40a70ab0.png)
![](https://csdnimg.cn/release/cmsfe/public/img/task.87b52881.png)
![](https://csdnimg.cn/release/cmsfe/public/img/share-circle.3e0b7822.png)
create table #kcb
(xlh int ,
shul int ,
ftshl int
)
insert into #kcb
(xlh,shul,ftshl)
select 1,20,0
union
select 2,55,0
union
select 3,100,0
select * from #kcb
例如提供一个数量A值为 30 想要得到数据为
-----------
xlh shul ftshl
1 20 20
2 55 10
3 100 0