请教一个SQL语句,满足某个条件的数据集中的两项之差求平均值 我有个表table1,表中有两个时间字段,一个字段是记录问题发生的时间Atime,另外一个是处理完这个问题的时间Btime,我现在想查询一段时间内(以Atime做查询条件),处理问题所用时间的平均值(以秒计算),请问这个SQL语句该怎么写呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select avg(datediff(ss,atime,btime)) from table1 where atime between '时间' and '时间' select col,avg(datediff(ss,atime,btime)) as 平均时间from tbgroup by col select col,avg(datediff(ss,atime,btime)) as 平均时间from tbgroup by col 100分求一条语句 求SQL一条语句..在线等 谢谢 系统存储sp_setapprole用法 sql server round()函数的问题 请问sqlserver2000正版软件的用户数是一个什么样的概念.企业版和标准版有什么区别 请教一个分类统计的问题, AS问题还没有解决哦,请关注一下 求一sql语句。 测试数据库的连接问题 求获得(yyyy/mm/dd hh:dd:ss)函数 select count(1) from tablename;select count(*) from tablename 的区别 如何实现删除1张主表的数据想关联的从表数据也一起删除
select avg(datediff(ss,atime,btime)) from table1 where atime between '时间' and '时间'
col,avg(datediff(ss,atime,btime)) as 平均时间
from
tb
group by
col
col,avg(datediff(ss,atime,btime)) as 平均时间
from
tb
group by
col