wesnoth/utils/mp-server/query-scripts/05-count-of-versions.sql
Pentarctagon 67c169ed80 Add scripts to pull various pieces of information from the MP database.
The intent being that I plan to run these once a month and post the results on the forum.
2020-03-26 14:54:53 -05:00

15 lines
589 B
SQL

select CLIENT_VERSION, count(*) as VERSION_COUNT
from
(
select distinct player.USER_ID, player.CLIENT_VERSION
from wesnothd_game_info game, wesnothd_game_player_info player
where YEAR(game.START_TIME) = YEAR(CURRENT_DATE - INTERVAL 1 MONTH)
and MONTH(game.START_TIME) = MONTH(CURRENT_DATE - INTERVAL 1 MONTH)
and game.END_TIME is not NULL
and TIMESTAMPDIFF(MINUTE, game.START_TIME, game.END_TIME) > 5
and game.INSTANCE_UUID = player.INSTANCE_UUID
and game.GAME_ID = player.GAME_ID
and player.USER_ID != -1
) src
group by CLIENT_VERSION
order by COUNT(*) desc