i would like to display the severity of each alarm , i noticed that the value returned is a number and i'm working on a way to change the value into something else .
i tried the CASE function as shown belwon but i'm getting error in the syntax:
SELECT
OAH.AlertObjects.AlertConfigurations.DisplayName AS [Alert Name]
, OAH.AlertObjects.AlertConfigurations.AlertID AS [Alert ID]
, COUNT( AlertHistoryID ) AS [Last 30 Days]
, CASE
When AC.Severity=1 then 'Warning'
When AC.Severity=2 then 'Critical'
ELSE AC.Severity
end AS [ Criticité ]
FROM Orion.AlertHistory OAH
INNER JOIN Orion.AlertConfigurations as AC on AC.AlertID = OAH.AlertObjects.AlertConfigurations.AlertID
WHERE EventType = 0 and oah.AlertObjects.AlertConfigurations.AlertID IN ('714','618','735','732','941','942') AND OAH.TimeStamp > GetUtcDate()-30
GROUP BY oah.AlertObjects.AlertConfigurations.AlertID
this CODE is working Fine without the CASE function.
Thanks for any help you can offer.