Skip to content

Commit 87fabb2

Browse files
authored
Merge pull request #145 from ddxv/main
Fix missing column from countries
2 parents a1367fa + fc29ae8 commit 87fabb2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
WITH countries_with_ranks AS (
22
SELECT
33
cs.name AS scenario_name,
4-
country_id
4+
cscc.country_id
55
FROM crawl_scenario_country_config AS cscc
66
LEFT JOIN crawl_scenarios AS cs ON cscc.scenario_id = cs.id
77
WHERE cs.name = 'app_ranks'
@@ -10,21 +10,22 @@ WITH countries_with_ranks AS (
1010
countries_with_details AS (
1111
SELECT
1212
cs.name AS scenario_name,
13-
country_id
13+
cscc.country_id
1414
FROM crawl_scenario_country_config AS cscc
1515
LEFT JOIN crawl_scenarios AS cs ON cscc.scenario_id = cs.id
1616
WHERE cs.name = 'app_details'
1717
)
1818

1919
SELECT
20+
c.id,
2021
c.alpha2,
2122
c.langen,
2223
coalesce(
23-
c.id IN (SELECT country_id FROM countries_with_ranks),
24+
c.id IN (SELECT cwr.country_id FROM countries_with_ranks AS cwr),
2425
FALSE
2526
) AS app_ranks,
2627
coalesce(
27-
c.id IN (SELECT country_id FROM countries_with_details),
28+
c.id IN (SELECT cwd.country_id FROM countries_with_details AS cwd),
2829
FALSE
2930
) AS app_details
3031
FROM countries AS c;

0 commit comments

Comments
 (0)