您的位置:首页技术文章
文章详情页

mysql - 这里的sql语句该怎么写

浏览:74日期:2022-06-16 15:37:17

问题描述

问题解答

回答1:

select hot,class from (select *from table order by hot desc) as a group by class

回答2:

class去重,就剩2行?

回答3:

描述的不是很清楚,我理解的是这样的:

SELECT `class` , COUNT(`hot`) as hot from `t` GROUP BY `class` ORDER BY `hot` DESC回答4:

我感觉意思就是取class对应hot最大的。那这样是否可以?

select max(hot) as hot ,class from table group by class;

相关文章: