Select 编号 As aa,min(abs(价格-0.01)) As bb into #tmp1 From Table group by 编号
Select sum(量) From Table join #tmp1 on 编号 = aa and min(abs(价格-0.01)) = bb
Drop Table #tmp1
Select sum(量) From Table join #tmp1 on 编号 = aa and min(abs(价格-0.01)) = bb
Drop Table #tmp1
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货