Sorting Data in a MySQL query before grouping | Hacker News Reader