mysql查月份的记录
如下表:
id   updateTIme1    2010-11-25 11:18:11
2    2010-11-25 11:18:11
3    2010-10-25 11:18:11
4    2009-11-25 11:18:11现要
1用mysql查出 2010年11月的记录
2用mysql查出  11月的记录
thanks

解决方案 »

  1.   

    1是明确的时间 可以用这个 select * from updateTIme where time>=2010-11-1 and time <=2010-11-30 这里的时间根据自己的时间格式来填写赋值的参数2.不是一条语句能写的 做往年同期比较
      

  2.   

    1   select * from table where date_format(updateTIme,'%Y-%m')='2010-11'; 2   select * from table where date_format(updateTIme,'%m')='11'; 
      

  3.   

    1 select * from table where date_format(updateTIme,'%Y-%m')='2010-11';  2 select * from table where date_format(updateTIme,'%m')='11'; 
    这个是对的