MySQL ORDER BY returns things in (apparently) random order !?

Posted by Luke H on Stack Overflow See other posts from Stack Overflow or by Luke H
Published on 2010-03-08T22:15:53Z Indexed on 2010/03/08 22:21 UTC
Read the original article Hit count: 182

Filed under:
|

The following query:

SELECT DISTINCT ClassName FROM SiteTree ORDER BY ClassName

is returning things in no apparent order!

I get the same result whether I quote column/table names, or use DISTINCT or not, or add ASC or DESC.

I assumed the indexes might be broken, or something like this, so tried dropping and recreating. Also tried REPAIR TABLE and CHECK TABLE.

The table collation is set to latin1_swedish_ci. All the textual columns are set to use UTF-8 and collation is set to utf8_general_ci

What could be causing this?

© Stack Overflow or respective owner

Related posts about mysql

Related posts about order-by