Hello. I have a whole bunch of MySQL rows containing a DATETIME field. Here is a simplified example of my table struture and data:
| date |
| 2004-02-13 12:00:00 |
| 2004-02-14 12:00:00 |
| 2004-02-17 12:00:00 |
| 2004-02-21 12:00:00 |
| 2004-02-22 12:00:00 |
| 2004-03-05 12:00:00 |
| 2004-03-14 12:00:00 |
| 2004-04-01 12:00:00 |
| 2004-05-02 12:00:00 |
| 2004-05-03 12:00:00 |
| 2004-05-13 12:00:00 |
| 2004-05-24 12:00:00 |
What I am looking for is a query that will basically:
SELECT * FROM table WHERE year='2004' AND month='5'
Both year and month are in the same field, so I'm not quite sure how to do this on the MySQL side. If someone could write a query statement for this, I would greatly appreciate it.