谁是留言最多的人
#对应留言最多的SQL语句 SELECT DISTINCT concat( '<a href="', comment_author_url, '">', comment_author, '</a>' ) , count( comment_author ) AS num_author FROM `wp_comments` WHERE comment_date >= '2007-01-01' AND comment_date < '2008-01-01' AND comment_author != 'Dianso' AND comment_type != 'trackback' AND comment_type != 'pingback' AND comment_approved =1 GROUP BY comment_author, comment_author_email ORDER BY num_author DESC
留言总共有多少
SELECT COUNT( * ) FROM `wp_comments` WHERE comment_date >= '2007-01-01' AND comment_date < '2008-01-01' AND comment_approved =1
文章总共有多少
SELECT COUNT( * ) FROM `wp_posts` WHERE post_date >= '2007-01-01' AND post_date < '2008-01-01' AND post_type = 'post' AND post_status = 'publish'