Quantcast
Viewing all articles
Browse latest Browse all 8

Re: How to do this Query?

--SQL Server 2012
SELECT ProductID,  Price FROM (SELECT ProductID,  Price
, SUM(Price) Over(Order By ProductID) as runningTotal
FROM @Products ) t
WHERE runningTotal<1000
ORDER BY  ProductID


Viewing all articles
Browse latest Browse all 8

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>