From 5e557240cee9384c6bfd763d2ae7b05e2b89c994 Mon Sep 17 00:00:00 2001 From: Peter Yates Date: Tue, 15 Nov 2022 10:14:22 +0000 Subject: [PATCH] Only return unchallenged partnerships --- analytics_queries/schools.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/analytics_queries/schools.sql b/analytics_queries/schools.sql index 4fc18b0131..5757b57673 100644 --- a/analytics_queries/schools.sql +++ b/analytics_queries/schools.sql @@ -8,7 +8,7 @@ dp.name as delivery_partner_name, c.start_year as cohort - FROM schools s + from schools s left outer join school_cohorts sc on s.id = sc.school_id left outer join cohorts c on sc.cohort_id = c.id @@ -17,6 +17,7 @@ left outer join delivery_partners dp on p.delivery_partner_id = dp.id where (c.start_year > 2020 or c.id is null) + and p.challenged_at is null ), just_2021 as ( select *