From be4f7e3d170363a4da6ff0a176aa42a2a8e82be1 Mon Sep 17 00:00:00 2001 From: Christian 'ketura' McCarty Date: Tue, 25 Oct 2022 02:15:20 -0500 Subject: [PATCH] Adding player deck export sql script. Adding format over time sql script. --- gemp-lotr/db/export-player-decks.sql | 10 ++++++++++ gemp-lotr/db/find-league-players.sql | 2 +- gemp-lotr/db/get-game-time-stats.sql | 9 +++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 gemp-lotr/db/export-player-decks.sql create mode 100644 gemp-lotr/db/get-game-time-stats.sql diff --git a/gemp-lotr/db/export-player-decks.sql b/gemp-lotr/db/export-player-decks.sql new file mode 100644 index 000000000..ba555dc80 --- /dev/null +++ b/gemp-lotr/db/export-player-decks.sql @@ -0,0 +1,10 @@ +SELECT + p.name AS player_name + ,d.name AS deck_name + ,CONCAT('https://play.lotrtcgpc.net/share/deck?id=', TO_BASE64(CONCAT(p.name, '|', d.name))) AS deck_URL +FROM gemp_db.deck d +INNER JOIN player p + ON p.id = d.player_id +WHERE p.name = 'met' + + diff --git a/gemp-lotr/db/find-league-players.sql b/gemp-lotr/db/find-league-players.sql index 94b8783a1..20ec048f3 100644 --- a/gemp-lotr/db/find-league-players.sql +++ b/gemp-lotr/db/find-league-players.sql @@ -26,7 +26,7 @@ INNER JOIN league_participation lp INNER JOIN league_match lm ON lm.league_type = l.`type` WHERE (lm.winner = lp.player_name OR lm.loser = lp.player_name ) - AND l.id = 545 + AND l.id = 554 GROUP BY lp.player_name ORDER BY Count(*) DESC; diff --git a/gemp-lotr/db/get-game-time-stats.sql b/gemp-lotr/db/get-game-time-stats.sql new file mode 100644 index 000000000..0c8de9aaa --- /dev/null +++ b/gemp-lotr/db/get-game-time-stats.sql @@ -0,0 +1,9 @@ +SELECT + format_name + ,YEAR(from_unixtime(end_date/1000)) AS Year + ,MONTH(from_unixtime(end_date/1000)) AS Month + ,from_unixtime(end_date/1000) AS PlayDate + ,COUNT(*) + #* +FROM game_history gh +GROUP BY YEAR(from_unixtime(end_date/1000)), MONTH(from_unixtime(end_date/1000)), format_name \ No newline at end of file