Added back in ORDER BY to ensure sql result is the same as check.