Query editor
WITHrents AS (SELECTSUM(l."lentAmount") AS "Number of rents",TRY_CAST(DATE_TRUNC('day', r.evt_block_time) AS DATE) AS dayFROMrenft_ethereum.ReNFT_evt_Rented AS rINNER JOIN renft_ethereum.ReNFT_evt_Lent AS l ON l."lendingId" = r."lendingId"GROUP BY2),fill_dates AS (SELECTTRY_CAST(dt AS TIMESTAMPWITHTIME ZONE) AS dFROMUNNEST (SEQUENCE(CURRENT_DATE - INTERVAL '30' day,CURRENT_DATE,INTERVAL '1' day)) AS _u (dt)),dates AS (SELECT*FROMrentsRIGHT JOIN fill_dates /* Right join to get all the matching dates with the transactions as well as the empty dates. */ ON rents.day = fill_dates.d) /* Join on date. */SELECTDATE_TRUNC('day', d),"Number of rents"FROMdates