34,590
社区成员
发帖
与我相关
我的任务
分享
--测试数据
create table 表(id int,countID int)
insert into 表
select 1,2 union all
select 2,2 union all
select 3,3 union all
select 4,1 union all
select 5,3 union all
select 6,2 union all
select 7,3 union all
select 8,1
select countID from 表
group by countID
order by count(countID) desc
select countid from tb group by countid order by count(*) desc
select countid from tb group by countid order by conut(*) desc
---..
SELECT countid
FROM TableName
GROUP BY countid
ORDER BY COUNT(countid) DESC
SELECT countid
FROM TableName
GROUP BY countid
ORDER BY COUNT(DISTINCT countid) DESC