MySQL timestamp select date range

后端 未结 7 1068
栀梦
栀梦 2021-02-01 14:32

Not sure really where to start with this one. Can anyone help/point me in the right direction.

I have a timestamp column in MySQL and I want to select a date range for e

相关标签:
7条回答
  • 2021-02-01 14:58

    If you have a mysql timestamp, something like 2013-09-29 22:27:10 you can do this

     select * from table WHERE MONTH(FROM_UNIXTIME(UNIX_TIMESTAMP(time)))=9;
    

    Convert to unix, then use the unix time functions to extract the month, in this case 9 for september.

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