MySQL timestamp select date range

Viewed 148517

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 example, all timestamps which are in Oct 2010.

Thanks.

7 Answers

This SQL query will extract the data for you. It is easy and fast.

SELECT *
  FROM table_name
  WHERE extract( YEAR_MONTH from timestamp)="201010";
Related