karpengold karpengold - 6 months ago 10
SQL Question

Search by month and day mqsql

i have table messages with column date (format DATETIME)
how i can search messages where date = xxxx-05-09 ?

select * from messages where date = 'xxxx-05-09';

Answer

Try this:

 select * from messages where Extract(Month from date) = 5 and Extract(Day from date) = 9;