This is a discussion on Comparison using mysql within the MySQL Database forums, part of the Database Forums category; Can i use the "LIKE" operator on a date in mysql? I want to compare the information by ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
strawberry wrote:
> Sure, this query selects all orders placed in the month of April, > regardless of the year... > > SELECT date FROM orders WHERE date LIKE '%-04-%'; You can, but you can also do: SELECT date FROM orders WHERE MONTH(date) = 4; |