fastix®: [MySQL] Sortierung

Beitrag lesen

Moin!

SELECT `id`, `datum`, SELECT([link:http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_datediff@title=datediff]('5000-01-01',`datum`) as `temp`) FROM `tabelle`  
           WHERE `datum` <= '2011-09-15'  
           ORDER BY `temp`  
           LIMIT 0,5;  

Kommt wohl besser ...

MFFG (Mit freundlich- friedfertigem Grinsen)

fastix