SQL 按分钟分组
作者:互联网
declare @gourpmi tinyint --按几分钟分组
set @gourpmi = 5
select cast(floor(cast(时间 as float)2460/gourpmi)gourpmi/60/24 as smalldatetime),SUM(字段),Count(字段)
from tb
group by cast(floor(cast(时间 as float)2460/gourpmi)gourpmi/60/24 as smalldatetime)
标签:24,2460,floor,float,分钟,cast,分组,SQL,gourpmi 来源: https://blog.51cto.com/alun51cto/2483830