PHP文章按日期(月日)SQL归档语句
2012-11-29 00:00
225 查看
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文章按日期(月日)SQL归档语句
- sql语句 改变日期格式
- Oracle sql语句算N个月后的日期
- 用SQL语句求某文章中出现关键词的个数--【叶子】
- SQL语句实现日期时间模糊查询
- php mssql几条常见的数据库分页 SQL 语句
- SQL语句中的日期计算
- ASP实现SQL语句日期格式的加减运算
- mysql如何在sql语句中用php变量
- PHP判断sql语句是否执行成功
- sql语句查询具体详细的日期
- SQL语句中日期的计算方法大全
- sql语句中日期相减的操作
- sql 语句日期用法及函数
- PHP如何获取刚插入数据的ID 和判断SQL语句是否成功执行
- 查询文章的上下篇Sql语句
- sql语句查询指定日期数据字段
- php中实现用数组妩媚地生成要执行的sql语句
- sql语句中获取datetime的日期部分或时间部分
- sql语句查询表和存储过程创建修改日期