From b7420ecd6f47273989d315f3e13cf894d2aac7cf Mon Sep 17 00:00:00 2001
From: schneefux <schneefux+commit@schneefux.xyz>
Date: Fri, 23 Jun 2017 22:28:14 +0200
Subject: fix filter joins

---
 crunch_global.sql | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'crunch_global.sql')

diff --git a/crunch_global.sql b/crunch_global.sql
index d7123b9..fe34356 100644
--- a/crunch_global.sql
+++ b/crunch_global.sql
@@ -41,7 +41,7 @@ JOIN `region` ON `region`.`name` = `player`.`shard_id` OR `region`.`name` = 'all
 
 -- filters
 JOIN `global_point_filters` ON `player`.`match_api_id` = `global_point_filters`.`match_api_id`
-JOIN `filter` ON (`filter`.`name` = 'all' AND `filter`.`dimension_on` = 'global') OR `global_point_filters`.`filter_id` = `filter`.`id`
+JOIN `filter` ON (`filter`.`name` = 'all' AND `filter`.`dimension_on` = 'global') OR `filter`.`id` IN (SELECT `global_point_filters`.`filter_id` FROM `global_point_filters` WHERE `global_point_filters`.`match_api_id` = `player`.`match_api_id`)
 
 -- being cheap
 JOIN `game_mode` ON `game_mode`.`id` = `player`.`game_mode_id` OR `game_mode`.`name` = 'all'
-- 
cgit v1.3.1

