LPS-35707 LPS-35743 Sort
LPS-35707 LPS-35743 Fix bad sql for other case