返回数说广场 #每日打卡#
1
众所周知,GROUP BY会对结果集进行排序。进而消耗较大的资源开销。
在MySQL 5.7版本中,以下哪些写法能避免文件排序?
A
select col1,sum(col2) from table group by col1 order by 1=1;
B
select col1,sum(col2) from table group by col1 order by null;
C
select col1,sum(col2) from table group by col1 order by rand();
D
select col1,sum(col2) from table group by col1 desc;
E
select col1,sum(col2) from table group by col1 asc;
F
select col1,sum(col2) from table group by col1 order by 1;
1
1 210
分享
评论
热门数说


