Skip to content

Instantly share code, notes, and snippets.

@christopherwxyz
Created August 9, 2023 18:14
Show Gist options
  • Save christopherwxyz/34cf88b64f4d3ffbc82379a70b0047d9 to your computer and use it in GitHub Desktop.
Save christopherwxyz/34cf88b64f4d3ffbc82379a70b0047d9 to your computer and use it in GitHub Desktop.
total and distinct farcaster activity yesterday
SELECT
(SELECT COUNT(*) FROM casts WHERE DATE(timestamp) = CURRENT_DATE - INTERVAL '1 day') AS total_casts_sent_yesterday,
(SELECT COUNT(DISTINCT fid) FROM casts WHERE DATE(timestamp) = CURRENT_DATE - INTERVAL '1 day') AS distinct_casts_sent_yesterday,
(SELECT COUNT(*) FROM reactions WHERE DATE(timestamp) = CURRENT_DATE - INTERVAL '1 day') AS total_reactions_sent_yesterday,
(SELECT COUNT(DISTINCT fid) FROM reactions WHERE DATE(timestamp) = CURRENT_DATE - INTERVAL '1 day') AS distinct_reactions_sent_yesterday;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment