Change sort order of database output