-- 最近30天的医说发布数量
SELECT substr(a.feed_publish_time,6, 5) AS ‘日期‘, count(*) AS ‘医说数‘ FROM xm_feed a WHERE
DATE_SUB(CURDATE(),INTERVAL 30 DAY) <= a.feed_publish_time GROUP BY substr(a.feed_publish_time,1, 10);
-- 最近30天的医说评论发布数量
SELECT substr(a.comm_create_time,6, 5) AS ‘日期‘, count(*) AS ‘医说评论数‘ FROM xm_feed_comment a WHERE DATE_SUB(CURDATE(),INTERVAL 30 DAY) <= a.comm_create_time GROUP BY substr(a.comm_create_time,1, 10);
-- 最近30天的医说扩散发布数量
SELECT substr(a.repost_create_time,6, 5) AS ‘日期‘, count(*) AS ‘医说评论数‘ FROM xm_feed_repost a WHERE DATE_SUB(CURDATE(),INTERVAL 30 DAY) <= a.repost_create_time GROUP BY substr(a.repost_create_time,1, 10);
-- 最近30天的医说点赞发布数量
SELECT substr(a.digg_create_time,6, 5) AS ‘日期‘, count(*) AS ‘医说评论数‘ FROM xm_feed_digg a WHERE DATE_SUB(CURDATE(),INTERVAL 30 DAY) <= a.digg_create_time GROUP BY substr(a.digg_create_time,1, 10);
-- 昨天的数据
SELECT count(*) as num FROM xm_user a WHERE a.user_audit_status = ‘AUDITED‘ AND date_sub(current_date(),interval 1 day) = substr(a.user_create_time,1, 10);
SELECT count(*) as num FROM xm_user a WHERE date_sub(current_date(),interval 1 day) = substr(a.user_create_time,1, 10);
SELECT count(*) as num FROM xm_feed a WHERE date_sub(current_date(),interval 1 day) = substr(a.feed_publish_time,1, 10);
SELECT count(*) as num FROM xm_feed_comment a WHERE date_sub(current_date(),interval 1 day) = substr(a.comm_create_time,1, 10);
SELECT count(*) as num FROM xm_feed_repost a WHERE date_sub(current_date(),interval 1 day) = substr(a.repost_create_time,1, 10);
SELECT count(*) as num FROM xm_feed_digg a WHERE date_sub(current_date(),interval 1 day) = substr(a.digg_create_time,1, 10);