ID Cout Type
1 30 A
2 80 A
3 14 B
4 38 B
5 90 A
怎么根据cout 从大到小排序?
怎么根据Type 类别 分别从大到小排序?
就是A类的从大到小排序
B类的从大到小排序?
16 个解决方案
#1
order by
#2
select * from t_table order by Type,Count Desc
#3
order by Count desc
#4
我的 Type 是varchar类型啊 ?
比如 软件技术
软件技术
信息管理
这样也可以order by吗?
#5
可以...
#6
可以!因为你排序的是Count
#7
select * from t_table order by case Type when 'A' then count desc else count asc end
#8
只要是字段就能被order by
#9
order by count desc是降序
order by 默认是升序
order by 默认是升序
#10
select * from 表名 order by Count,Type Desc
#11
select * from t_table order by Type,Count Desc
正解
正解
#12
select * from t_table order by Type,Count Desc
#13
order by 就可以了
#14
select *
from table
order by Cout DESC,Type DESC
from table
order by Cout DESC,Type DESC
#15
select * from t_table order by Type,Count Desc
#16
select *
from table
order by Cout DESC,Type DESC
from table
order by Cout DESC,Type DESC
#1
order by
#2
select * from t_table order by Type,Count Desc
#3
order by Count desc
#4
我的 Type 是varchar类型啊 ?
比如 软件技术
软件技术
信息管理
这样也可以order by吗?
#5
可以...
#6
可以!因为你排序的是Count
#7
select * from t_table order by case Type when 'A' then count desc else count asc end
#8
只要是字段就能被order by
#9
order by count desc是降序
order by 默认是升序
order by 默认是升序
#10
select * from 表名 order by Count,Type Desc
#11
select * from t_table order by Type,Count Desc
正解
正解
#12
select * from t_table order by Type,Count Desc
#13
order by 就可以了
#14
select *
from table
order by Cout DESC,Type DESC
from table
order by Cout DESC,Type DESC
#15
select * from t_table order by Type,Count Desc
#16
select *
from table
order by Cout DESC,Type DESC
from table
order by Cout DESC,Type DESC