diff --git a/PostgreSQL/prism/prism.sql b/PostgreSQL/prism/prism.sql index ccb9d1d..a83d1c6 100644 --- a/PostgreSQL/prism/prism.sql +++ b/PostgreSQL/prism/prism.sql @@ -10,7 +10,8 @@ from activities; -- 数据总量 select max(activity_id) - min(activity_id) + 1 from activities; -select count(*) from activities; +select count(*) +from activities; -- 1天内的数据,按action分组排序 select b.action_id, b.action, count(b.action_id) @@ -247,3 +248,11 @@ where action_id = (select action_id from actions where action = 'block-form') 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天内的 block-form 行为,按时间倒序排序,前500个 +select * +from activities +where action_id = (select action_id from actions where action = 'block-form') + and timestamp > EXTRACT(EPOCH FROM current_timestamp(0))::bigint - 86400 * 1 +order by timestamp desc +limit 500;