Hgta的博客

个人博客

MYSQL 查询一个月内数据的SQL语句

Posted on | 7月 3, 2011 | 2 Comments

select * from phome_ecms_info where DATE_SUB(CURDATE(), INTERVAL 1 MONTH) <= DATE(FROM_UNIXTIME(newstime)) and checked=1 order by onclick desc limit 15

Comments

2 Responses to “MYSQL 查询一个月内数据的SQL语句”

  1. 电影八五娱乐网
    10月 15th, 2011 @ 下午 12:49

    错误的

  2. 电影八五娱乐网
    10月 15th, 2011 @ 下午 12:49

    根本就没用
    下面的是计算一个月内数据
    and to_days(now())-to_days(o.createtime)<30

Leave a Reply





About

博主 hgta

Search

Admin