MYSQL, why ORDER BY DESC fails but ORDER BY ASC works?
Why is only one of these queries working?
Works:
SELECT *
FROM `global_rank`
WHERE rank_type = 2
AND rank < 1531.26367188
AND id <> 103
ORDER BY rank ASC
Failure (i.e. returns 0 rows):
SELECT *
FROM `global_rank`
WHERE rank_type = 2
AND rank < 1531.26367188
AND id <> 103
ORDER BY rank DESC
+3
user257543
source
to share
2 answers
No problem with your sql queries they are flawless.
Check how you validate the query results. I sometimes know that we are missing results (common human error).
+4
Ravikumar
source
to share
After pondering this for hours, I'm pretty sure it must be a corrupted index problem. Drop the index on rank
and re-add it to see if the behavior has changed.
+1
wallyk
source
to share