代码: 全选
mysql> select Year(from_unixtime(user_regdate)) as Year, Month(from_unixtime(user_regdate)) as Month, count(*) as Total from phpbb_users group by Year,Month;
代码: 全选
mysql> select Year(from_unixtime(post_time)) as Year, Month(from_unixtime(post_time)) as Month, count(*) as Total from phpbb_posts group by Year,Month;
代码: 全选
mysql> select Year(from_unixtime(user_lastvisit)) as Year, Month(from_unixtime(user_lastvisit)) as Month, count(*) as Total from phpbb_users group by Year,Month;
代码: 全选
mysql> select Year(from_unixtime(user_lastvisit-user_regdate))-1970 as Year, Month(from_unixtime(user_lastvisit-user_regdate)) as Month, count(*) as Total from phpbb_users where user_lastvisit > user_regdate group by Year,Month;
代码: 全选
mysql> select Hour(from_unixtime(post_time)) as Hour, count(*) as Total from phpbb_posts group by Hour;
代码: 全选
mysql> select forum_id,topic_id,topic_views,topic_title from phpbb_topics order by topic_views desc limit 20;
代码: 全选
mysql> select forum_id,topic_id,topic_replies,topic_title from phpbb_topics order by topic_replies desc limit 20;
来自 https://forum.ubuntu.com.cn/viewtopic.php?f=16&t=277604