This is expected behavior. http://dev.mysql.com/doc/refman/5.0/en/select.html
"If you use GROUP BY, output rows are sorted according to the GROUP BY columns as if you had an ORDER BY for the same columns." "If ORDER BY occurs within a subquery and also is applied in the outer query, the outermost ORDER BY takes precedence. " The above statements mean that you are sorting by subkey, which has duplicates. In case of two rows having the same value in the sorting column, the returned row is not guaranteed to be in any specific order. -- mysql ignores view order when selecting with group by https://bugs.launchpad.net/bugs/247727 You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to mysql-dfsg-5.0 in ubuntu. -- Ubuntu-server-bugs mailing list [email protected] Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs
