如果是SQLServer select top 1 datepart(hh,timecolumn)as timecolumn ,count(*) as [COUNT] from mytable group by datepart(hh,timecolumn) order by count(*) desc
select count(*) as c,DATEPART (hh,t) as tt from table1 group by DATEPART(hh,t) order by c desct为时间字段
Convert(Char(2), DatePart(Month, timecolumn)) + '-' +
Convert(Char(2), DatePart(Day, timecolumn)) + ' ' +
Convert(Char(2), DatePart(Hour, timecolumn)),
Max(Count(*))
From tablename
Group By Convert(Char(4), DatePart(Year, timecolumn)) + '-' +
Convert(Char(2), DatePart(Month, timecolumn)) + '-' +
Convert(Char(2), DatePart(Day, timecolumn)) + ' ' +
Convert(Char(2), DatePart(Hour, timecolumn))
select top 1 datepart(hh,timecolumn)as timecolumn ,count(*) as [COUNT] from mytable group by datepart(hh,timecolumn) order by count(*) desc