How to compare only day and month with date field in mysql?
For example, I\'ve a date in one table: 2014-07-10
Similarly, another date 2000-07-10<
you can do it with the DAYOFMONTH and MONTH function:
SELECT *
FROM table
WHERE DAYOFMONTH(field) = 31 AND MONTH(field) = 12 AND id = 1;
EDIT: Of course you can write following too if you want to compare two fields:
SELECT *
FROM table
WHERE
DAYOFMONTH(field) = DAYOFMONTH(field2)
AND MONTH(field) = MONTH(field2)
AND id = 1 ...;
for further information have a look at the manual: