日期:2014-05-17 浏览次数:20820 次
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 top 1 h_2,count(h_2) '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) as s_cq FROM [TCFX].[dbo].[C1]
group by h_2
order by s_cq desc