当前位置: 动力学知识库 > 问答 > 编程问答 >

sql - MYSQL why would ORDER BY DESC fail but ORDER BY ASC work?

问题描述:

Why would only one of these queries work?

Works:

SELECT *

FROM `global_rank`

WHERE rank_type = 2

AND rank < 1531.26367188

AND id <> 103

ORDER BY rank ASC

Fails (ie returns 0 rows):

SELECT *

FROM `global_rank`

WHERE rank_type = 2

AND rank < 1531.26367188

AND id <> 103

ORDER BY rank DESC

网友答案:

There is no problem with your sql queries they are flawless.

Please check the way you are validating your query results. I know sometimes we overlook the results ( common human error).

网友答案:

After pondering this for a few hours, I'm almost sure it has to be a corrupted index problem. Drop the index on rank and re-add it to see if the behavior changes.

分享给朋友:
您可能感兴趣的文章:
随机阅读: