合并重复行,求和时间并获取平均时间或求和平均时间
听起来有点复杂,我正在努力查询。希望你能帮助我。
我需要的是按名称或日期合并,计数和时间列应该是总和 (02:05 :00) 和 aht 列应该是两个值的平均值。
我没有找到解决方案,因为所有内容都按视图分组,但我需要将数据放在一行中并删除第二行......
it sounds a bit complicated and I am struggling with a query. Hopefully you can help me out.
What I need is to merge by name or date, the count and time column should be sum (02:05:00) and aht column should be average of both values.
I didnt found a solution, as all comes up with a group by view, but I need to have the data in one row and the second row deleted...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
选择 SUM 和 AVERAGE 并不难,请参见下面的小提琴:
DBFIDDLE
输出:
您可以添加此新行,然后删除按
name
和 < 分组时 count >=2 的所有行代码>日期。Selecting the SUM and AVERAGE is not hard, see below fiddle:
DBFIDDLE
output:
You can add this new row, and after this delete all rows that have a count >=2 when grouped by
name
anddate
.