search

Home  >  Q&A  >  body text

mysql - 请问数据库字段为年月日,传进的参数为月,怎么查询那个月所对应的数据

迷茫迷茫2867 days ago1111

reply all(1)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-04-17 16:52:28

    select * from table WHERE date_format(date,'%Y-%m') = '2017-3'

    If you need to add the year in front, you can use the database function date_format
    For the format, please refer to this article
    http://blog.csdn.net/kangbrot...

    reply
    0
  • Cancelreply