Query editor
WITHrentals AS (SELECT*FROMrenft_ethereum.ReNFT_evt_Rented AS rINNER JOIN renft_ethereum.ReNFT_evt_Lent AS l ON l."lendingId" = r."lendingId"),names AS (SELECTCOUNT(name) AS "Total rents",name AS "NFT Name"FROMrentalsLEFT JOIN tokens.nft AS t /* Join on token address so we can get the name of the project. Left join so we get the empty names too. */ ON t.contract_address = rentals."nftAddress"GROUP BY"name")SELECT*FROMnamesWHERE"Total rents" > 0 /* Remove any empty counts */ORDER BY"Total rents" DESC