如何按时间分组?我想这一点,但它给错误“无效列名‘时间’。”:如何在SQL中对我的列进行分组?
select Count(Page) as VisitingCount, CONVERT(VARCHAR(5), Date, 108) as [Time]
from scr_SecuristLog
where Date between '2009-05-04 00:00:00' and '2009-05-06 14:58'
and [user] in (select USERNAME from scr_CustomerAuthorities)
group by [Time] order by [VisitingCount] asc
列时间不存在的错误?我认为你需要按日期转换而不是名称[时间] – u07ch 2009-05-04 14:10:09
但我需要时间组? – Penguen 2009-05-04 14:12:01
猜猜我需要学会打字速度较慢,如果后面相同的答案会被接受; – 2009-05-04 14:33:41