Hi,
We may try the following query:
Select
S.ManagedEntityMonitorRowId,
sum(S.InRedStateMilliseconds/100000) as InRedState,
sum(S.InYellowStateMilliseconds/100000) as InYellowState,
sum(S.InGreenStateMilliseconds/100000) as InGreenState,
sum(S.InWhiteStateMilliseconds/100000) as InWhiteState,
sum(S.InDisabledStateMilliseconds/100000) as InDisabledState,
sum(S.InPlannedMaintenanceMilliseconds/100000) as InPlannedMaintenance,
sum(S.InUnplannedMaintenanceMilliseconds/100000) as InUnplannedMaintenance,
sum(S.HealthServiceUnavailableMilliseconds/100000) as HealthServiceUnavailable
FROM [OperationsManagerDW].[dbo].[vStateDailyFull] S group by S.ManagedEntityMonitorRowId
Hope the above information helps.
Alex Zhu
If the response is helpful, please click "Accept Answer" and upvote it.