Answer the question
In order to leave comments, you need to log in
How to make a selection of the nearest birthdays?
There are fields with dates, you need to display three fields starting with today and sorted in the correct order.
Raw data:
1955-01-02
1966-02-06
1984-02-12
1976-03-10
1999-04-04
1958-11-02
Should be:
1958-11-02
1955-01-02
1966-02- 06
What would the request look like?
Answer the question
In order to leave comments, you need to log in
select birthday
from some_table
order by dayofyear(birthday - interval dayofyear(now()) -1 day) asc
limit 3
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question