karpengold karpengold - 1 year ago 76
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 Source

Try this:

 select * from messages where Extract(Month from date) = 5 and Extract(Day from date) = 9;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download