I was trying to find customers born in month of december from a table customers using this query :
SELECT *
FROM customers
WHERE date_of_birth LIKE '____-12-%' ;
But it throws an error : ER_WRONG_VALUE: Incorrect DATE value: '____-12-%'
The type of date_of_birth value is DATE that is it's defined in table as date_of_birth DATE,
Snapshot of the error that i got :
What exactly is wrong here? I remember earlier ones i have used this and it worked fine but now (may be due to new updates) it's not working. Doesn't even seem to be because of MySQL Strict Mode. I can't get what exactly is causing problem.
Also please don't suggest me alternatives i already have those like using MONTH() works fine :
SELECT *
FROM customers
WHERE MONTH(date_of_birth) = 12;