wesnoth/utils/mp-server/query-scripts/23-oos-count-by-modification-and-version.sql
Pentarctagon fbeae32002 Rename database column SOURCE to ADDON_ID.
Also rename VERSION to ADDON_VERSION.
2023-01-06 19:59:26 -06:00

12 lines
627 B
SQL

select content.ID as MODIFICATION, content.ADDON_ID as ADDON, content.ADDON_VERSION, count(*) as OOS_COUNT
from wesnothd_game_info game, wesnothd_game_content_info content
where game.INSTANCE_UUID = content.INSTANCE_UUID
and game.GAME_ID = content.GAME_ID
and content.TYPE = 'modification'
and game.OOS = 1
and 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
group by content.ID, content.ADDON_ID, content.ADDON_VERSION
order by count(*) desc