bug 1010: Changed Order by in SQL-statement