mysql - 这里的sql语句该怎么写
天蓬老师
天蓬老师 2017-04-17 16:04:39
0
4
418
天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(4)
大家讲道理

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

左手右手慢动作

Class is deduplicated, only 2 lines are left?

Ty80

The description is not very clear,
This is what I understand:

SELECT `class` , COUNT(`hot`) as hot from `t` GROUP BY `class` ORDER BY `hot` DESC
伊谢尔伦

I think it means taking the class that corresponds to the largest hot. Is this okay?

 select max(hot) as hot ,class from table  group by class;
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!