MLDZMNt1
Updated 2023-11-22
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
›
⌄
with t1 as (select
SUBSTRING(post_text, CHARINDEX('#', post_text),CHARINDEX(' ', post_text)) as tag,
upper(SUBSTRING(tag, CHARINDEX('#', tag)+1)) as hashtag,
tx_hash
from near.social.fact_posts
WHERE BLOCK_TIMESTAMP >= CURRENT_DATE - {{Time_period_days}}
and post_text ilike '#%'
and post_text not ilike '##%'
and tag not in ('##','###', '# ')
)
select
distinct hashtag,
count(tx_hash) as "Posts"
from t1
where hashtag!=''
group by 1 having hashtag is not null
order by 2 desc
limit 10
Run a query to Download Data