WordPress Sql 查询

谁是留言最多的人

#对应留言最多的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'

发表评论

电子邮件地址不会被公开。

 smiles smiles smiles smiles smiles smiles smiles smiles smiles smiles smiles smiles smiles smiles smiles smiles smiles smiles smiles smiles smiles smiles

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

无觅相关文章插件,快速提升流量