Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sql/reports/statistics/general/country-member-details.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ WITH member_profiles AS (
SELECT
m."userId" AS user_id,
COALESCE(
NULLIF(TRIM(m."competitionCountryCode"), ''),
NULLIF(TRIM(m."homeCountryCode"), '')
NULLIF(TRIM(m."homeCountryCode"), ''),
NULLIF(TRIM(m."competitionCountryCode"), '')
) AS country_code,
m.handle,
m."photoURL" AS photo_url
Expand Down
4 changes: 2 additions & 2 deletions sql/reports/statistics/general/first-place-by-country.sql
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ member_wins AS (
winners_country AS (
SELECT
COALESCE(
NULLIF(TRIM(m."competitionCountryCode"), ''),
NULLIF(TRIM(m."homeCountryCode"), '')
NULLIF(TRIM(m."homeCountryCode"), ''),
NULLIF(TRIM(m."competitionCountryCode"), '')
) AS country_code,
w.wins
FROM member_wins w
Expand Down
8 changes: 4 additions & 4 deletions sql/reports/statistics/general/top-winners-by-country.sql
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ stats_wins AS (
winner_profiles AS (
SELECT
COALESCE(
NULLIF(TRIM(m."competitionCountryCode"), ''),
NULLIF(TRIM(m."homeCountryCode"), '')
NULLIF(TRIM(m."homeCountryCode"), ''),
NULLIF(TRIM(m."competitionCountryCode"), '')
) AS country_code,
m."userId" AS user_id,
m.handle,
Expand All @@ -47,8 +47,8 @@ winner_profiles AS (
LEFT JOIN members."memberMaxRating" mmr
ON mmr."userId" = m."userId"
WHERE COALESCE(
NULLIF(TRIM(m."competitionCountryCode"), ''),
NULLIF(TRIM(m."homeCountryCode"), '')
NULLIF(TRIM(m."homeCountryCode"), ''),
NULLIF(TRIM(m."competitionCountryCode"), '')
) IS NOT NULL
AND wins.wins > 0
),
Expand Down
Loading