From 392160fdbbb45a93ebc90d57577fb62227de4c5e Mon Sep 17 00:00:00 2001
From: schneefux <schneefux+commit@schneefux.xyz>
Date: Sat, 1 Apr 2017 12:02:40 +0200
Subject: rewrite in node

---
 queries/player/count_player_matches.sql | 29 -----------------------------
 1 file changed, 29 deletions(-)
 delete mode 100644 queries/player/count_player_matches.sql

(limited to 'queries/player/count_player_matches.sql')

diff --git a/queries/player/count_player_matches.sql b/queries/player/count_player_matches.sql
deleted file mode 100644
index 226cacc..0000000
--- a/queries/player/count_player_matches.sql
+++ /dev/null
@@ -1,29 +0,0 @@
-with stats as (
-with plr as (
-select 
-    match.patch_version as patch_version,
-    player.api_id as player_api_id,
-    match.game_mode as game_mode,
-    participant.winner as winner
-from
-    match, roster, participant, player
-where
-    match.api_id = roster.match_api_id and
-    roster.api_id = participant.roster_api_id and
-    participant.player_api_id = player.api_id and
-    player.api_id = $1)
-select
-    (select distinct(player_api_id) from plr),
-    (select distinct(patch_version) from plr),
-    (select count(*) as played from plr), 
-    (select count(*) as wins from plr where winner = true), 
-    (select count(*) as casual_played from plr where game_mode like '%casual%'),
-    (select count(*) as casual_wins from plr where game_mode like '%casual%' and winner = true),
-    (select count(*) as ranked_played from plr where game_mode like '%ranked%'),
-    (select count(*) as ranked_wins from plr where game_mode like '%ranked%' and winner = true),
-    (select 0 as streak)
-)
-INSERT INTO player_stats(player_api_id, patch_version, played, wins, casual_played, casual_wins, ranked_played, ranked_wins, streak)
-    SELECT * FROM stats
-ON CONFLICT(player_api_id) DO
-    UPDATE SET (player_api_id, patch_version, played, wins, casual_played, casual_wins, ranked_played, ranked_wins, streak) = (SELECT * FROM stats)
-- 
cgit v1.3.1

