fixing weird ordering in queries

Summary: ahhfjasdkjfk

Test Plan: none

Reviewers: neil

Maniphest Tasks: T8249

Differential Revision: http://grizzly.memsql.com/D4602