SG data2024-06-20 11:09 AM
Updated 2024-06-20
999
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
›
⌄
WITH
date_range AS (
SELECT
DATEADD(day, seq4(), '2023-01-01'::DATE) AS day
FROM
TABLE(GENERATOR(ROWCOUNT => 366)) -- Generate 366 rows to cover the entire year
WHERE
day <= '2024-01-01' -- Ensure the date range covers the necessary period
),
combined_transactions AS (
SELECT
'ethereum' AS dataset,
BLOCK_TIMESTAMP,
FACT_TRANSACTIONS_ID
FROM ethereum.core.fact_transactions
WHERE DATE_TRUNC('day', BLOCK_TIMESTAMP) BETWEEN '2023-01-01' AND '2024-01-01'
UNION ALL
SELECT
'polygon' AS dataset,
BLOCK_TIMESTAMP,
FACT_TRANSACTIONS_ID
FROM polygon.core.fact_transactions
WHERE DATE_TRUNC('day', BLOCK_TIMESTAMP) BETWEEN '2023-01-01' AND '2024-01-01'
UNION ALL
SELECT
'bsc' AS dataset,
BLOCK_TIMESTAMP,
FACT_TRANSACTIONS_ID
FROM bsc.core.fact_transactions
WHERE DATE_TRUNC('day', BLOCK_TIMESTAMP) BETWEEN '2023-01-01' AND '2024-01-01'
UNION ALL
QueryRunArchived: QueryRun has been archived