From d09b506b0337833e6144f3b39cad42ca68bee9cc Mon Sep 17 00:00:00 2001 From: Fortern Date: Fri, 26 Dec 2025 04:02:47 +0800 Subject: [PATCH] prism --- PostgreSQL/prism/prism.sql | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/PostgreSQL/prism/prism.sql b/PostgreSQL/prism/prism.sql index aea08f1..8faf9b9 100644 --- a/PostgreSQL/prism/prism.sql +++ b/PostgreSQL/prism/prism.sql @@ -152,3 +152,12 @@ where action_id = (select action_id from actions where action = 'entity-death') and timestamp > EXTRACT(EPOCH FROM current_timestamp(0))::bigint - 86400 * 1 group by cause_player_id, player order by count(cause_player_id) desc; + +-- 1天内的 entity-death 按实体分组 +select affected_entity_type_id, entity_types.entity_type, count(*) +from activities + left join entity_types on activities.affected_entity_type_id = entity_types.entity_type_id +where action_id = (select action_id from actions where action = 'entity-death') + and timestamp > EXTRACT(EPOCH FROM current_timestamp(0))::bigint - 86400 * 1 +group by affected_entity_type_id, entity_types.entity_type +order by count(*) desc;