PHP文章按日期(月日)SQL歸檔語句
更新時間:2012年11月29日 20:18:05 作者:
PHP文章按日期(月日)SQL歸檔PHP文章按日期(月)SQL歸檔實現(xiàn)語句,需要的朋友可以參考下
復(fù)制代碼 代碼如下:
select FROM_UNIXTIME(pubtime, '%Y-%m') as pubtime, count(*) as cnt from articles group by FROM_UNIXTIME(pubtime, '%Y-%m')
PHP文章按日期(日)SQL歸檔
復(fù)制代碼 代碼如下:
select FROM_UNIXTIME(pubtime, '%Y-%m-%d') as pubtime, count(*) as cnt from articles group by FROM_UNIXTIME(pubtime, '%Y-%m-%d')
非時間戳日期格式歸檔(date_format格式化日期)
復(fù)制代碼 代碼如下:
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
相關(guān)文章
PHP面向?qū)ο蟪绦蛟O(shè)計(OOP)之方法重寫(override)操作示例
這篇文章主要介紹了PHP面向?qū)ο蟪绦蛟O(shè)計(OOP)之方法重寫(override)操作,簡單描述了php面向?qū)ο蟪绦蛟O(shè)計中方法重寫的原理,并結(jié)合實例形式分析了php方法重寫相關(guān)實現(xiàn)技巧與注意事項,需要的朋友可以參考下2018-12-12