GetSorting SQL function was added