问题描述:

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.

相关阅读:
Top