SELECT TOP 92 PERCENT
Convert(DateTime,Floor(Cast((DateTime) as Float)*24)/24,0) AS SummaryDateTime,
MIN(APM_ApplicationAvailability.PercentAvailability) AS MIN_of_ApplicationAvailability,
Nodes.Caption AS NodeName
FROM
(Nodes INNER JOIN APM_AlertsAndReportsData ON (Nodes.NodeID = APM_AlertsAndReportsData.NodeId)) INNER JOIN APM_ApplicationAvailability ON (APM_AlertsAndReportsData.ApplicationId = APM_ApplicationAvailability.ApplicationID)
WHERE
( DateTime BETWEEN 40907 AND 41205 )
AND
(
(APM_AlertsAndReportsData.ApplicationName LIKE '%HTTP%') AND
(Nodes.Caption = 'www.example.com')
)
GROUP BY Convert(DateTime,Floor(Cast((DateTime) as Float)*24)/24,0),
Nodes.Caption
ORDER BY SummaryDateTime ASC
Above query giving me following result, which attached as an image.
I want to write a query to filter out all 0.00% results so it will just gives only 0.00% data, because i don’t care about 100% data. I don’t know how to filter data.
Is that your full query? You have mixed aggregates (
MIN) and non-aggregates (Datetime).I’ll assume you have a GROUP BY somewhere, but in any case, the straightforward approach will be to subquery it.
Normally, for aggregate queries, you can also use the HAVING clause, such as