select * from student s order by nvl(length(trim(s.sname)),0) asc -- nvl(attribute, default value) 当属性值为空时就将其值设默认值 -- length(attrbute) 得到字符串的长度 -- trim(attribute) 去掉字符的空格
oracle根据某表字段长度排序
最新推荐文章于 2022-05-01 15:39:11 发布
select * from student s order by nvl(length(trim(s.sname)),0) asc -- nvl(attribute, default value) 当属性值为空时就将其值设默认值 -- length(attrbute) 得到字符串的长度 -- trim(attribute) 去掉字符的空格