Mysql中group by 1,2释义

下面语句:

select "name","class","score" from score_tbl where "score" > 80 group by 1,2

等价于:

select "name","class","score" from score_tbl where "score" > 80 group by "name","class"

 

含义:

  "group by 1,2"的意思是说:按照select后面参数的第1列、第2列分组(从1开始计算,不含0)

posted on 2021-09-12 09:44  呼延灼  阅读(2574)  评论(0)    收藏  举报

导航