34,588
社区成员
发帖
与我相关
我的任务
分享
SELECT top 1 h_2 , count(h_2) as s_cq FROM [TCFX].[dbo].[C1]
group by h_2
order by s_cq desc
select h_2,s_cq
from
(
SELECT h_2 ,count(h_2) as s_cq,
row_number() over(order by count(h_2) desc) as rownum
FROM [TCFX].[dbo].[C1]
group by h_2
)t
where t.rownum = 1
SELECT top 1 h_2,count(h_2) 's_cq'
FROM [TCFX].[dbo].[C1]
group by h_2
order by s_cq desc
SELECT top 1 h_2 , count(h_2) as s_cq FROM [TCFX].[dbo].[C1]
group by h_2
order by s_cq desc