我正在查询监控工具后端报告的每日可用性的平均值,问题是当我查询我得到多个平均值时。在示例输出和查询下面:
NodeName| DailyNodeAvailability
Manila | 81%
Subic | 91%
| 85%
| 28%
Laguna | 85%
SELECT Convert(DateTime,Floor(Cast((DateTime) as Float)),0) AS SummaryDate,
Nodes.Caption AS NodeName,
AVG(DailyNodeAvailability.Availability) AS AVERAGE_of_Availability
FROM
Nodes INNER JOIN DailyNodeAvailability ON (Nodes.NodeID = DailyNodeAvailability.NodeID)
WHERE
( DateTime BETWEEN 43094 AND 43125 )
GROUP BY Convert(DateTime,Floor(Cast((DateTime) as Float)),0),
Nodes.Caption
ORDER BY SummaryDate ASC
答案 0 :(得分:0)
似乎在"!Convert(DateTime,Floor(Cast((DateTime)as Float)),0),"上进行分组。 可以为节点名称提供多个值。
尝试仅分组 GROUP BY Nodes.Caption