diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-04-01 12:02:40 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-04-01 12:02:40 +0200 |
| commit | 392160fdbbb45a93ebc90d57577fb62227de4c5e (patch) | |
| tree | 596f20239e7f8127397923e8c406cd41a970ecf7 /queries/participant/stats.sql | |
| parent | 74c975556c0e067e60f99fb96d64d973210bf786 (diff) | |
| download | compiler-392160fdbbb45a93ebc90d57577fb62227de4c5e.tar.gz compiler-392160fdbbb45a93ebc90d57577fb62227de4c5e.zip | |
rewrite in node
Diffstat (limited to 'queries/participant/stats.sql')
| -rw-r--r-- | queries/participant/stats.sql | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/queries/participant/stats.sql b/queries/participant/stats.sql deleted file mode 100644 index fe4025f..0000000 --- a/queries/participant/stats.sql +++ /dev/null @@ -1,21 +0,0 @@ -WITH stats AS ( - SELECT - participant.api_id, - match.patch_version, - CASE WHEN roster.hero_kills=0 - THEN 0 - ELSE (kills+assists)/roster.hero_kills::float - END AS kills_participation, - CASE WHEN participant.deaths=0 - THEN 0 - ELSE (kills+assists)/deaths::float - END AS kda - FROM participant - JOIN roster ON roster.api_id=participant.roster_api_id - JOIN match ON match.api_id=roster.match_api_id - WHERE participant.api_id = $1 -) -INSERT INTO participant_stats(participant_api_id, patch_version, kills_participation, kda) -SELECT * FROM stats -ON CONFLICT(participant_api_id) DO -UPDATE SET(participant_api_id, patch_version, kills_participation, kda) = (SELECT * FROM stats) |
