File tree Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Original file line number Diff line number Diff line change 1- WITH bill AS (
2- SELECT
3- cb." challengeId" AS challenge_id,
4- MAX (cb." billingAccountId" ) FILTER (WHERE cb." billingAccountId" IS NOT NULL ) AS billing_account_id
5- FROM challenges." ChallengeBilling" cb
6- WHERE cb." billingAccountId" = ' 80000062'
7- GROUP BY cb." challengeId"
8- ),
9- base_challenges AS (
1+ WITH base_challenges AS (
102 SELECT
113 c.* ,
12- b .billing_account_id
4+ ba .billing_account_id
135 FROM challenges." Challenge" c
14- JOIN bill b
15- ON b .challenge_id = c .id
6+ JOIN LATERAL (
7+ SELECT
8+ MAX (cb." billingAccountId" ) AS billing_account_id
9+ FROM challenges." ChallengeBilling" cb
10+ WHERE cb." challengeId" = c .id
11+ AND cb." billingAccountId" = ' 80000062'
12+ ) ba ON TRUE
1613 WHERE c." createdAt" >= now() - interval ' 4 months'
14+ AND ba .billing_account_id IS NOT NULL
1715),
1816project_details AS (
1917 SELECT
You can’t perform that action at this time.
0 commit comments