Select current months records mysql from timestamp column

前端 未结 10 2080
一整个雨季
一整个雨季 2020-12-05 15:31

I have a mysql DB that has a TIMESTAMP field titled date. How can I select all fields where the month is the current month?

Thanks in advance!

10条回答
  •  离开以前
    2020-12-05 15:55

    SELECT [columns] 
    FROM [the_table] 
    WHERE MONTH([date_column]) = MONTH(CURDATE())
    

    Replace the text between [] (including the []) with your data.

提交回复
热议问题