select address, "Amount of Asset Held At Block", count(1) OVER() ::string as "Total # of Addresses Holding" from (
select
address,
sum(amount) as "Amount of Asset Held At Block"
from
algorand.silver.asset_flow
where
block_id <= {{Block_ID}}
and asset_id = {{Asset_ID}}
group by
address, block_timestamp::Date
having
sum(amount) >= {{Min_Amount_Holding}}
)