Select
distinct a.EVENT_CONTRACT as contract,
b.CONTRACT_NAME as contract_name,
count(distinct a.tx_id) as numb_Use,
count(a.tx_id) as num_uses_count
from flow.core.fact_events a full join flow.core.dim_contract_labels b
on b.EVENT_CONTRACT = a.EVENT_CONTRACT
where a.TX_SUCCEEDED = 'TRUE'
and a.block_timestamp >= '2022-05-09'
group by 1 , 2
order by 3 desc
limit 10