with base as(
SELECT
tokenid,
NFT_TO_ADDRESS as wallet_address,
RANK() OVER (PARTITION BY tokenid ORDER BY block_timestamp DESC) as tr_rank
FROM ethereum.core.ez_nft_transfers
WHERE nft_address in ('0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb','0xb7f7f6c52f2e2fdb1963eab30438024864c313f6') and NFT_TO_ADDRESS!='0x0000000000000000000000000000000000000000'
)
SELECT *
FROM(
SELECT
count(DISTINCT tokenid) as number_of_NFT,
RANK() OVER (ORDER BY number_of_NFT DESC) as rank,
wallet_address
FROM base
WHERE tr_rank=1
GROUP BY wallet_address)
WHERE rank<=10