binhachon12. [Easy] Opensea ENS Sales - Top 10 sales of all time
Updated 2021-12-24
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
-- select * from ethereum.nft_events
-- where contract_address = '0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85'
-- limit 10
with tx_id_with_ID as (
select
*,
event_inputs:id as id,
row_number() over (partition by id order by block_timestamp desc) as rownumber
from
ethereum.events_emitted
where event_name = 'NameRegistered'
and id is not null
qualify rownumber = 1
),
tx_id_with_name as (
select
*,
event_inputs:name as name
from
ethereum.events_emitted
where event_name = 'NameRegistered'
and name is not null
),
id_with_name as (
select
id,
name,
case
when name is not null then name
else id end
as corrected_name
from
tx_id_with_ID
left join tx_id_with_name on tx_id_with_ID.tx_id = tx_id_with_name.tx_id
),
nft_sales as (
Run a query to Download Data