Order by query.

This is a bit annoying, but here's how you do it.