Use DATE_FORMAT instead:
SELECT DATE_FORMAT('2000-07-10','%m-%d')
yields
07-10
Here’s your query re-written with DATE_FORMAT()
:
SELECT *
FROM table
WHERE DATE_FORMAT(field, '%m-%d') = DATE_FORMAT('2000-07-10', '%m-%d')
AND id = "1"
More Related Contents:
- Recreating a query using INNER JOIN? [duplicate]
- What is better subquery vs literal on IN clause in mysql
- SQL query return data from multiple tables
- Left Outer Join doesn’t return all rows from my left table?
- Get a list of dates between two dates
- How to populate a table with a range of dates?
- MySQL Query GROUP BY day / month / year
- MySQL SELECT only not null values
- MySQL SELECT WHERE datetime matches day (and not necessarily time)
- MySQL Query – Records between Today and Last 30 Days
- Ordering by specific field value first
- Difference between two dates in MySQL
- SELECT / GROUP BY – segments of time (10 seconds, 30 seconds, etc)
- Select mysql query between date?
- Get the latest date from grouped MySQL data
- Checking multiple columns for one value
- MySQL #1093 – You can’t specify target table ‘giveaways’ for update in FROM clause
- How to select the most recent set of dated records from a mysql table
- MySQL INSERT INTO … VALUES and SELECT
- How to select one row randomly taking into account a weight?
- quick selection of a random row from a large table in mysql
- Syntax error when using except in a query
- SELECT query return 1 row from each group
- MySQL INNER JOIN select only one row from second table
- MySQL Select Query – Get only first 10 characters of a value
- SQL query to check if a name begins and ends with a vowel
- Insert/ Update random date in MySQL
- #1292 – Incorrect date value: ‘0000-00-00’ [duplicate]
- How to SELECT by MAX(date)?
- SQL date format convert? [dd.mm.yy to YYYY-MM-DD]