real_date 用来记录年月日select *  from t_biz_racing_calender where real_date >= date_format(current_date,'%Y-%c') 照道理应该只取得当月之后的数据,但是实际却查出所有的数据求解

解决方案 »

  1.   

    real_date 是什么数据类型? 日期? 数字? 字符?
      

  2.   

    real_date什么类型,内容是什么,如果是日期时间型
    select * from t_biz_racing_calender where date_format(real_date,'%Y-%c') >= date_format(current_date,'%Y-%c')
      

  3.   

    select *  from t_biz_racing_calender where real_date >= date_format(current_date,'%Y-%m')  
      

  4.   

    内容是什么?类似201111这种?
    date_format(current_date,'%Y-%m')
      

  5.   

    real_date 内容是2011-11-11这种CREATE TABLE `t_biz_racing_calender` (
      `ID` int(11) NOT NULL AUTO_INCREMENT,
      `REAL_DATE` varchar(20) DEFAULT NULL,
      `DATE_STATE` int(11) DEFAULT NULL,
      `CONTENT` varchar(512) DEFAULT NULL,
      `OP_STATE` int(11) DEFAULT NULL,
      `CREATE_BY` varchar(16) DEFAULT NULL,
      `CREATE_TIME` varchar(20) DEFAULT NULL,
      `UPDATE_BY` varchar(16) DEFAULT NULL,
      `UPDATE_TIME` varchar(20) DEFAULT NULL,
      `IS_DELETED` int(11) DEFAULT NULL,
      `TYPE` varchar(32) DEFAULT NULL,
      `CALENDER_TIME` varchar(64) DEFAULT NULL,
      PRIMARY KEY (`ID`),
      KEY `FK42A135D4A125405B` (`TYPE`)
    )ENGINE=MyISAM AUTO_INCREMENT=516 DEFAULT CHARSET=gbk;INSERT INTO `t_biz_racing_calender` VALUES ('1', '2011-6-16', '1', '8:00 奥迪试车', null, '测试用户1', '2011-06-20 21:16:21', '管理员', '2011-06-24 16:13:10', null, '10008-10', null);
      

  6.   

    select * from t_biz_racing_calender where STR_TO_DATE(real_date,'%Y-%c-%d') >= current_date-interval day(current_date) day;