mysql语句,分组去重,排序问题

2024-11-13 04:27:56
推荐回答(2个)
回答1:

order by cont ->order by count(*)
select count(*) as cont,ctt_id from tmp GROUP BY ctt_id order by count(*) desc limit 0,20

回答2:

报什么错?把DISTINCT去掉看看