Code: Select all
SELECT E.*,M.Name AS MonitorName,M.DefaultScale
FROM Monitors AS M INNER JOIN Events AS E ON (M.Id = E.MonitorId)
WHERE
E.Archived = '0' and TRUE /*ExistsInFileSystem*/ and E.EndDateTime IS NOT NULL and (( E.StorageId = '4' and TRUE /*DiskPercent*/ ) or ( E.StorageId = '5' and TRUE /*DiskPercent*/ )) ORDER BY Id ASC LIMIT 200