I have following SQL query
SELECT TOP 10000 AVG(DailyNodeAvailability.Availability) AS AVERAGE_of_Availability
FROM Nodes
INNER JOIN DailyNodeAvailability
ON (Nodes.NodeID = DailyNodeAvailability.NodeID)
WHERE
( DateTime > (GetDate()-7) )
AND
(
(
(Nodes.Caption LIKE '%server1%') OR
(Nodes.Caption LIKE '%server2%') OR
(Nodes.Caption LIKE '%server3%')
)
)
It’s giving me average availability report of 3 servers. But I want least availability. For example.
Server1 = 100%
Server2 = 97%
Server3 = 88%
I want SQL query result in least one which would be Server3 = 88% (Not average)
How do I modify existing query to make it work?
There was confusion so, I am attaching picture of result. Its giving me single result but in average and i don’t want average i need least result value in my result, According example.

This will give you the minimum, but it will not tell for which server it is showing. To get the server name (Nodes.Caption) we have to do a bit more. As it is not in the original query so, I am not including that part, otherwise it will make it a little bit more complicated.