Skip to content

Instantly share code, notes, and snippets.

@almet
Last active February 25, 2025 11:47
Show Gist options
  • Save almet/2d2821ddeaf94481cf6ceb416391ac6d to your computer and use it in GitHub Desktop.
Save almet/2d2821ddeaf94481cf6ceb416391ac6d to your computer and use it in GitHub Desktop.
ihatemoney stats
SELECT COUNT(*)
FROM project
WHERE id IN (
SELECT p.project_id
FROM bill b
JOIN person p ON b.payer_id = p.id
GROUP BY p.project_id
HAVING COUNT(*) > 10
AND MAX(b.date) > CURRENT_DATE - INTERVAL '90 days'
);
date count
2025-02-25 1026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment