SELECT MONTH('2005-06-12')  月,  当天就写实际日期

解决方案 »

  1.   

    我现在如下查询:
    select substring(birthday,6,7) from register 
    显示的是:
    12-03
    12-05
    05-06
    08-09
    如何只取月份
    12 
    05
    08
      

  2.   

    select *,substring(birthday,6,7) as birthday from register where birthday like'%04-%'
    问题已经解决,呵呵!
      

  3.   

    select * from table_name where left(brithday,7)='2005-06';
      

  4.   

    楼主,你的生日根本就不是日期型嘛,所以这样,如果是日期函数用Month就很好了.
      

  5.   

    select date_format(birthday,'%m') from register