select from_unixtime(pubtime, '%y-%m') as pubtime, count(*) as cnt from articles group by from_unixtime(pubtime, '%y-%m')
php文章按日期(日)sql归档
select from_unixtime(pubtime, '%y-%m-%d') as pubtime, count(*) as cnt from articles group by from_unixtime(pubtime, '%y-%m-%d')
非时间戳日期格式归档(date_format格式化日期)
select date_format(`post_date`,'%y%m%d') as pubtime, count(*) as cnt from wp_posts where `post_status`='publish' group by date_format(`post_date`,'%y%m%d') order by `id` desc
select date_format(`post_date`,'%y%m%d') as pubtime,date_format(`post_date`,'%m 月 %d 日') as shijian,count(*) as cnt from wp_posts where `post_status`='publish' group by date_format(`post_date`,'%y%m%d') order by `id` desc limit 0,7
如对本文有疑问,
点击进行留言回复!!
网友评论