时间:2021-07-01 10:21:17 帮助过:68人阅读
方法一:先按照长度排序再按照ASCII码排序
select display_name from desktop order by display_name desc, length(display_name) desc;
方法二:向前/左用空格补齐32位后再排序
select display_name from desktop order by LPAD(display_name, 32, ‘ ‘) desc;
补充:向后/右补齐为RPAD(str,len,padstr)
mysql 字符串先按照长度排序再按照ASCII码排序
标签:pad 排序 desktop spl mysql from ascii 字符 esc