Maison  >  Questions et réponses  >  le corps du texte

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

迷茫迷茫2742 Il y a quelques jours1036

répondre à tous(1)je répondrai

  • 伊谢尔伦

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

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

    如果你需要前面加年份的话,可以使用数据库函数date_format
    格式可以参看这篇文章
    http://blog.csdn.net/kangbrot...

    répondre
    0
  • Annulerrépondre