sql,求和小于必定值的数据行

select 

count(id),sum(Price)
from [T_AddPrice] as a
where (select sum(Price) from [T_AddPrice] as b where a.id<=b.id)<1000
--order by id
相关文章
相关标签/搜索