Topic: Reading not all sampling
There is conditionally such label:
Also there is a certain parameter, whether which needs to be checked up the total count exceeds parameter or not
Most simple it is natural to make in a forehead
select sum (count) into sum_count from table; if sum_count> = param_sum_count then Exceeded
But records much also it would be desirable to optimize, I need to read records until then while sum (count) <param_sum_count and as soon as sum (count)> = param_sum_count to stop to read.
There is still an idea through bulk collect limit 1, but it would be desirable SQL to manage if it probably.