Added ability to do ordering in the selector given the right SQL is passed to it.