SELECT row by DATEPART()

后端 未结 4 520
耶瑟儿~
耶瑟儿~ 2020-12-03 21:24

I need to get rows from the database where the records are of one month. I tried this SELECT:

$result = mysql_query(\"SELECT * FROM my_table WHERE DATEPART(\         


        
4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-03 22:01

    There is no DATEPART function in MySQL. Use MONTH(date_column) or EXTRACT(MONTH FROM date_column) instead.

提交回复
热议问题