diff --git a/utils/mp-server/query-scripts/28-count-of-players-by-count-of-games.sql b/utils/mp-server/query-scripts/28-count-of-players-by-count-of-games.sql new file mode 100644 index 00000000000..9de3e17531d --- /dev/null +++ b/utils/mp-server/query-scripts/28-count-of-players-by-count-of-games.sql @@ -0,0 +1,19 @@ +select COUNT_OF_GAMES, count(*) as COUNT_OF_USERS +from +( + select USER_ID, count(*) as COUNT_OF_GAMES + from + ( + select player.USER_ID + from wesnothd_game_player_info player, wesnothd_game_info game + where player.USER_ID != -1 + and player.INSTANCE_UUID = game.INSTANCE_UUID + and player.GAME_ID = game.GAME_ID + and game.END_TIME is not NULL + and TIMESTAMPDIFF(MINUTE, game.START_TIME, game.END_TIME) > 5 + group by player.INSTANCE_UUID, player.GAME_ID + ) i1 + group by USER_ID +) i2 +group by COUNT_OF_GAMES +order by COUNT_OF_GAMES diff --git a/utils/mp-server/query-scripts/28-addon-download-counts.sql b/utils/mp-server/query-scripts/29-addon-download-counts.sql similarity index 100% rename from utils/mp-server/query-scripts/28-addon-download-counts.sql rename to utils/mp-server/query-scripts/29-addon-download-counts.sql