re_annMost Popular NFTs by Total Number of Transactions (Sales + Mints)
    Updated 2024-04-28
    SELECT NFT_ADDRESS, TOKENID, COUNT(*) AS TotalTransactions -- Selects the NFT_ADDRESS and TOKENID columns and counts the total transactions for each unique combination
    FROM (
    SELECT NFT_ADDRESS, TOKENID FROM aptos.nft.ez_nft_sales -- Subquery retrieves NFT_ADDRESS and TOKENID from the ez_nft_sales table
    UNION ALL -- Combines the results of the two subqueries while retaining duplicate rows
    SELECT NFT_ADDRESS, TOKENID FROM aptos.nft.ez_nft_mints -- Subquery retrieves NFT_ADDRESS and TOKENID from the ez_nft_mints table
    ) AS Combined -- Combines the results of the two subqueries into a single virtual table named Combined
    GROUP BY NFT_ADDRESS, TOKENID -- Groups the combined results by NFT_ADDRESS and TOKENID
    ORDER BY TotalTransactions DESC -- Orders the results by the total number of transactions in descending order
    LIMIT 10; -- Limits the output to the top 10 rows

    QueryRunArchived: QueryRun has been archived