SELECT * FROM lookup_date WHERE date >= NOW() -> IF date == date THEN ORDER BY date LIMIT 3 -> ELSE ORDER BY date LIMIT 1 -> END IF;