Is it possible to do sums of aggregation that stops aggregating once the condition is reached? Say I have a table amounts with millions of rows tallying up to some number, but I'm really just checking if it's > 100. Is there a way to stop aggregation since taking this:

SELECT SUM(amount)
FROM stored_value;


Into this:

SELECT SUM(amount)
FROM stored_value
HAVING SUM(amount) &gt; 100;


However this does not change anything on the amount of aggregation. Something that would work with date ranges.
If you don't care what order your rows that contribute to the sum is in:

select * from (
    select ...n sum(amount) over () as sm
    from ...
    where ...
) as x
where sm &gt; 100


If you do care about the order, you should add info on how the cumulative sum is calculated:

select * from (
    select ...n sum(amount) over (order by ...) as sm
    from ...
    where ...
) as x
where sm &gt; 100


You may even sumarise per something like:

select * from (
    select ...n sum(amount) over (partition by ... 
                                  order by ...) as sm
    from ...
    where ...
) as x
where sm &gt; 100


However, since you are talking about stopping, when the sum reaches something I suggest what you need is something like:

select * from (
    select ...n sum(amount) over (partition by ... 
                                  order by ...) as sm
    from ...
    where ...
) as x
where sm &lt;= 100