I have the following table of people and their birthdays:
name birthday
----------------------
yannis 1979-06-29
natalia 1980-08-19
kostas
Here is one way:
SELECT
name,
birthday,
birthday + INTERVAL (YEAR(CURRENT_DATE) - YEAR(birthday)) YEAR AS currbirthday,
birthday + INTERVAL (YEAR(CURRENT_DATE) - YEAR(birthday)) + 1 YEAR AS nextbirthday
FROM birthdays
ORDER BY CASE
WHEN currbirthday >= CURRENT_DATE THEN currbirthday
ELSE nextbirthday
END
Notes:
SQLFiddle