源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

PHP文章按日期(月日)SQL归档语句

  • 时间:2020-11-19 21:51 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:PHP文章按日期(月日)SQL归档语句
[u]复制代码[/u] 代码如下:
select FROM_UNIXTIME(pubtime, '%Y-%m') as pubtime, count(*) as cnt from articles group by FROM_UNIXTIME(pubtime, '%Y-%m')
PHP文章按日期(日)SQL归档
[u]复制代码[/u] 代码如下:
select FROM_UNIXTIME(pubtime, '%Y-%m-%d') as pubtime, count(*) as cnt from articles group by FROM_UNIXTIME(pubtime, '%Y-%m-%d')
非时间戳日期格式归档(date_format格式化日期)
[u]复制代码[/u] 代码如下:
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
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部