In my SQL table i have birthdates stores in the column bday as (for example) 1987-02-31
I want to have a SELECT query that only chooses from the year, and ignores the month and day, such as :
SELECT FROM users WHERE bday=1987
is this possible to do with the dates stored this way?
You can simply use the
YEAR()MySQL function: