Hi All,
I need to do a count of individual items in one column I call status. The status column contains only three values (‘Not Available’, Partially Available’, ‘Fully Available’). My sql statement below just gets me the count for the status column, I need to know how to count the status column for the specific items.
SELECT EEI.EEI_NAME, COUNT(EEI_INSTA NCE_RECOVERY.ST ATUS) AS EXPR1
FROM MTS_EVENT INNER JOIN EEI_INSTANCE_RE COVERY
ON MTS_EVENT.EVENT _ID = EEI_INSTANCE_RE COVERY.EVENT_ID
INNER JOIN EEI_OBJECT_INST ANCE
ON EEI_INSTANCE_RE COVERY.INSTANCE _ID = EEI_OBJECT_INST ANCE.INSTANCE_I D
INNER JOIN EEI ON EEI_OBJECT_INST ANCE.EEI_ID = EEI.EEI_ID
WHERE (EEI.EEI_TYPE = 'Critical Infrastructure' )
AND (EEI_INSTANCE_R ECOVERY.EVENT_I D = :EVENT_ID)
GROUP BY EEI.EEI_NAME ORDER BY EEI.EEI_NAME ASC
The results from this query gets me part way there, it returns is like
EEI_NAME EXPR1
Name_one....... ..8
Name_two....... ..5
My goal is to have it return
EEI_NAME EXPR1 Not_Available Partially_Avail able Fully_Availavle
Name_one....... 8 ..............2 ............... .........2..... ............... .. 4
Name_two....... .5............. ..0 ............... .........0 ............... .......5
Thank you for any help!
I need to do a count of individual items in one column I call status. The status column contains only three values (‘Not Available’, Partially Available’, ‘Fully Available’). My sql statement below just gets me the count for the status column, I need to know how to count the status column for the specific items.
SELECT EEI.EEI_NAME, COUNT(EEI_INSTA NCE_RECOVERY.ST ATUS) AS EXPR1
FROM MTS_EVENT INNER JOIN EEI_INSTANCE_RE COVERY
ON MTS_EVENT.EVENT _ID = EEI_INSTANCE_RE COVERY.EVENT_ID
INNER JOIN EEI_OBJECT_INST ANCE
ON EEI_INSTANCE_RE COVERY.INSTANCE _ID = EEI_OBJECT_INST ANCE.INSTANCE_I D
INNER JOIN EEI ON EEI_OBJECT_INST ANCE.EEI_ID = EEI.EEI_ID
WHERE (EEI.EEI_TYPE = 'Critical Infrastructure' )
AND (EEI_INSTANCE_R ECOVERY.EVENT_I D = :EVENT_ID)
GROUP BY EEI.EEI_NAME ORDER BY EEI.EEI_NAME ASC
The results from this query gets me part way there, it returns is like
EEI_NAME EXPR1
Name_one....... ..8
Name_two....... ..5
My goal is to have it return
EEI_NAME EXPR1 Not_Available Partially_Avail able Fully_Availavle
Name_one....... 8 ..............2 ............... .........2..... ............... .. 4
Name_two....... .5............. ..0 ............... .........0 ............... .......5
Thank you for any help!
Comment