PHP文章按日期(月日)SQL归档语句
代码如下:
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
相关推荐
xuanlvhaoshao 2020-05-07
militala 2020-01-13
cjylean 2019-12-04
tanrong 2020-01-14
Carlos 2020-01-08
明月清风精进不止 2020-01-01
tanrong 2019-12-13
明月清风精进不止 2019-10-23
zhangdonghang 2019-07-18
chenxcd 2019-09-06
sylalak 2014-08-30
FightFourEggs 2010-08-14
廖金龙 2013-03-20
wangcomputer00 2012-07-06
windex000 2018-10-15
libingjy 2016-10-05
MikeG 2015-07-26