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
相關文章
相關標籤/搜索