4/5/2007
Easy MySQL Sorting Mistake
If you have a compound ORDER BY clause with a direction (ASC or DESC), make sure to specify the directions of all columns.
Correct:
ORDER BY col1 DESC, col2 DESC
Wrong:
ORDER BY col1, col2 DESC
The latter forces a filesort.
Popularity: 12%


