解决方案 »

  1.   

    select * from table where DATEDIFF(NOW(),concat(year,month,day)) < 5
      

  2.   


    -- 好象是这个 datediff ,没有环境,没办法测试
    select * from mytable where datediff(current_timpstamp() , y.m.d ) <= 5 
      

  3.   

    试试这个:select * from table where DATEDIFF(curdate(),concat(year,month,day)) < 5 
    没试过,感觉MySql有点坑,竟然要这样
      

  4.   

    select * 
    from 一个表
    where year*1000+month*100+day > curdate()-interval 5 day + 0