with Contracts AS
(SELECT creator_address AS "Address",COUNT(*) AS "Contract deployed",
CREATED_BLOCK_TIMESTAMP
FROM mezo.testnet.dim_contracts
GROUP BY 1,3
)
SELECT DATE_TRUNC(day, CREATED_BLOCK_TIMESTAMP) AS Date,
COUNT(DISTINCT "Address") AS "Contract Deployer",
SUM ("Contract deployed") AS "Contract Deployed"
FROM Contracts
GROUP BY 1
ORDER BY 1 DESC