telperionTriBuzz- NFTs by Holder
    Updated 2023-05-09
    -- forked from Owlpha - NFTs by Holder copy @ https://flipsidecrypto.xyz/edit/queries/2b07810e-faa5-4057-bc84-65ef5419d0a6

    -- forked from BROZO - NFTs by Holder @ https://flipsidecrypto.xyz/edit/queries/82802873-a523-474e-9b81-ca05acc98c25

    -- forked from IOCF - NFTs by Holder @ https://flipsidecrypto.xyz/edit/queries/65ad1fe0-46fb-482b-bc71-f0bfb1643141

    -- forked from DRILL - NFTs by Holder @ https://flipsidecrypto.xyz/edit/queries/f708a9a2-619f-438a-9088-92750e3ab257

    -- forked from Project A - NFTs by Holder @ https://flipsidecrypto.xyz/edit/queries/c58ab9dd-0bed-45bc-824f-c5176ed333f7

    -- forked from Project A - KPIs @ https://flipsidecrypto.xyz/edit/queries/76b4caed-c41a-4b88-b8f2-380eb3af2b2d
    SELECT
    *,
    CONCAT(CAST("# of NFTs"/SUM("# of NFTs") OVER()*100 AS DECIMAL(10,1)),'%') "Percent of Total"
    FROM(
    SELECT
    CONCAT(LEFT(NFT_TO_ADDRESS,5),'...',RIGHT(NFT_TO_ADDRESS,4)) as Holder,
    SUM(ROW_NUM) as "# of NFTs"
    FROM
    (SELECT
    CONCAT(PROJECT_NAME, ':', TOKENID) as ID,
    PROJECT_NAME,
    TOKENID,
    MAX(BLOCK_TIMESTAMP) TIMESTAMP,
    NFT_TO_ADDRESS,
    ROW_NUMBER() OVER (
    PARTITION BY ID
    ORDER BY MAX(BLOCK_TIMESTAMP) DESC
    ) row_num
    FROM polygon.core.ez_nft_transfers
    WHERE PROJECT_NAME = 'TriBuzz'
    GROUP BY NFT_TO_ADDRESS, ID, TOKENID, PROJECT_NAME
    ORDER BY CAST(TOKENID as INT), MAX(BLOCK_TIMESTAMP) ASC)
    WHERE row_num = 1
    GROUP BY Holder
    ORDER BY "# of NFTs" desc)
    Run a query to Download Data