PHP文章按日期(月日)SQL归档语句
更新时间:2012年11月29日 20:18:05 作者:
PHP文章按日期(月日)SQL归档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
相关文章
PHP面向对象程序设计(OOP)之方法重写(override)操作示例
这篇文章主要介绍了PHP面向对象程序设计(OOP)之方法重写(override)操作,简单描述了php面向对象程序设计中方法重写的原理,并结合实例形式分析了php方法重写相关实现技巧与注意事项,需要的朋友可以参考下2018-12-12
最新评论