Created
June 6, 2025 19:58
-
-
Save Sdy603/a898cb1194bf9374354208da73d5f5ca to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
du.name, | |
du.email, | |
COUNT(DISTINCT pr.id) AS number_of_prs_merged, | |
COUNT(DISTINCT CASE WHEN cdu.is_active THEN cdu.date END) AS cursor_days_active | |
FROM cursor_daily_user_metrics cdu | |
INNER JOIN dx_users du | |
ON du.email = cdu.email | |
INNER JOIN pull_requests pr | |
ON pr.dx_user_id = du.id | |
WHERE pr.merged >= CURRENT_DATE - INTERVAL '30 days' | |
AND cdu.date >= CURRENT_DATE - INTERVAL '30 days' | |
GROUP BY du.name, du.email; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment