From b9829f374ad1b843bc7cb5b9d96e54547e440afc Mon Sep 17 00:00:00 2001 From: Fortern Date: Sun, 4 Jan 2026 16:42:45 +0800 Subject: [PATCH] prism --- PostgreSQL/prism/prism.sql | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/PostgreSQL/prism/prism.sql b/PostgreSQL/prism/prism.sql index e6da649..cfe328a 100644 --- a/PostgreSQL/prism/prism.sql +++ b/PostgreSQL/prism/prism.sql @@ -117,6 +117,25 @@ where action_id = (select action_id from actions where action = 'block-break') group by affected_block_id, blocks.name order by count((affected_block_id, blocks.name)) desc; +-- 1天内,爆炸破换方块,按坐标分组 +select world_id, x, y, z, count((world_id, x, y, z)) +from activities +where action_id = (select action_id from actions where action = 'block-break') + and cause_id = (select causes.cause_id from causes where cause = 'explosion') + and timestamp > EXTRACT(EPOCH FROM current_timestamp(0))::bigint - 86400 * 1 +group by world_id, x, y, z +order by count((world_id, x, y, z)) desc; + +-- 1天内,爆炸破换方块,按方块类型分组 +select blocks.name, count((affected_block_id, blocks.name)) +from activities +left join blocks on activities.affected_block_id = blocks.block_id +where action_id = (select action_id from actions where action = 'block-break') + and cause_id = (select causes.cause_id from causes where cause = 'explosion') + and timestamp > EXTRACT(EPOCH FROM current_timestamp(0))::bigint - 86400 * 1 +group by affected_block_id, blocks.name +order by count((affected_block_id, blocks.name)) desc; + -- 1天内,非明确实体触发的block-break行为,按坐标分组 select world_id, x, y, z, count((world_id, x, y, z)) from activities