Query editor
withlast_held as (SELECT*,row_number() over (partition bycontract_address,token_idorder byblock_number desc,evt_index desc) as last_transferFROMnft.transfers trWHEREblockchain = 'polygon'AND contract_address = 0x903d8cAA9c94075a08D3e7758B7a20b9FC604854AND block_date >= timestamp '2023-09-07'AND "from" = 0x0000000000000000000000000000000000000000AND TRY_CAST(token_id AS INTEGER) >= 100000AND TRY_CAST(token_id AS INTEGER) < 200000)SELECTlhu.to as holder,ens.name as holder_ens,cardinality(array_agg(lhu.token_id)) as tokens_held,array_agg(lhu.token_id) as token_idsFROMlast_held lhuLEFT JOIN labels.ens ens ON ens.address = lhu.toWHERElhu.last_transfer = 1AND lhu.to != 0x0000000000000000000000000000000000000000GROUP BY1,2ORDER BY3 DESC