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)
文章标签 SQL自定时间分组 文章分类 SQL Server 数据库
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)
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M