Query from Solarwinds Database Help.
Hi all I'm a beginner at SQL and understand the principals. We have a network monitoring database, with a reports creator that's powerful to a certain extent. However when i try this query, i get total times of the events in our network monitor. I'm looking for not total times from all nodes, but anything in the last 4 months that is over 239minutes in outage duration. Here is a sample of the query perhaps someone can point me in the right direction.
(SELECT TOP 1
FROM Events AS Endtime
WHERE EndTime.EventTime > StartTime.EventTime AND EndTime.EventType = 5
AND EndTime.NetObjectType = 'N'
AND EndTime.NetworkNode = StartTime.NetworkNode
ORDER BY EndTime.EventTime)) AS OutageDurationInMinutes
FROM Events StartTime INNER JOIN Nodes ON StartTime.NetworkNode = Nodes.NodeID
WHERE (StartTime.EventType = 1) AND (StartTime.NetObjectType = 'N') AND
eventtime between dateadd(month, -1, getdate()) and getdate() AAND 'OutageDurationInMinutes' >= '239'
ORDER BY OutageDurationInMinutes ASC