Page 1 of 1

Sorting issue

Posted: Mon Dec 15, 2008 4:05 pm
by bnordin
I'm a developer myself and noticed a classic issue. The scores are sorted as text and not by numbers. Therefore, 200 is > 1000. To get things to sort correctly, you should cast the number before sorting.

MySQL Cast Example:
ORDER BY
CAST(score AS INT)

However, a better alternative is to store the number as an integer. Then, a cast is not required, storage space is reduced, and performance increases.

Re: Sorting issue

Posted: Mon Dec 15, 2008 5:50 pm
by Alex
Ah, the problem is not in MySQL, it sorts ok (as int) when you use cache report. When you use live report, javascript should do the sorting after all characters have been loaded (or when you press abort button), but it could be that it's not sorting well, I'll take a look. Thanks for pointing this out :)