Tobi_12024-07-02 11:09 AM
    Updated 2024-07-02
    SELECT
    DATE_TRUNC('day', BLOCK_TIMESTAMP) AS sale_day,
    COUNT(TX_ID) AS daily_sales,
    SUM(COUNT(TX_ID)) OVER (ORDER BY DATE_TRUNC('day', BLOCK_TIMESTAMP)) AS cumulative_sales
    FROM
    solana.nft.fact_nft_sales;
    WHERE
    BLOCK_TIMESTAMP >= DATEADD(day, -30, CURRENT_TIMESTAMP)
    AND SUCCEEDED = TRUE
    GROUP BY
    sale_day
    ORDER BY
    sale_day;

    QueryRunArchived: QueryRun has been archived