发布网友
共5个回答
热心网友
String类型升序/降序排序用 "order by 字段 ASC/DESC"
sql1:select * from tablename order by username asc;
解释:上面语句的意思是用过username 字段升序排序后输出 tablename表的结果。
sql2:select * from tablename order by username desc;
解释:上面语句的意思是用过username 字段降序排序后输出 tablename表的结果。
热心网友
select col1,col2,col3 from table1
order by col1 desc
--查询的这3列都是string类型。
--这样的是倒序,去掉desc就是默认为升序。
--显示上可能和你想到不完全一样,字符和数字排序是不一样的,你自己习惯就好。在数据库中,有字符集可以供选择,中国的外国的都有,中国的就可以按照汉字进行排序,外国的,就可以按照国外的特有方式进行排序,你只需要选择就好了,
热心网友
order by stringcol desc(降序),order by stringcol 默认是升序
热心网友
group by
热心网友
Arrys.sort()