I\'m trying to write a query to select users of a database whose birthdays are in the next 7 days.
I\'ve done a lot of research but I can\'t come up with a working s
I did a lot "researches" and here is my solution, I guess it is very easy to understand!
SELECT *, (366 + DAYOFYEAR(birth_date) - DAYOFYEAR(NOW())) % 366 as left_days FROM `profile` ORDER BY left_days;