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


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


source


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


source







All Articles