mysql where statement date issue

前端 未结 1 1192
情深已故
情深已故 2021-01-25 13:55

hope someone can help,

What i`m trying to do is pull all results from the database for any given month, Is the possible using a mysql query only (no php).

Im usi

相关标签:
1条回答
  • 2021-01-25 14:25
    SELECT 
        * 
    FROM 
        table_name 
    WHERE 
        MONTH(Display_Date) = MONTH(CURDATE())
    AND YEAR(Display_Date) = YEAR(CURDATE())
    

    reference

    • MONTH()
    • YEAR()
    0 讨论(0)
提交回复
热议问题