WITH A AS(
SELECT 'HR' AS ID, 'INACTIVE' AS STATUS, 1 AS CNT FROM DUAL UNION ALL
SELECT 'SYS' AS ID, 'ACTIVE' AS STATUS, 1 AS CNT FROM DUAL UNION ALL
SELECT 'SYS' AS ID, 'INACTIVE' AS STATUS, 5 AS CNT FROM DUAL UNION ALL
SELECT 'PUBLIC' AS ID, 'INACTIVE' AS STATUS, 5 AS CNT FROM DUAL ),
B AS(
SELECT 'ACTIVE' AS STATUS FROM DUAL UNION ALL
SELECT 'INACTIVE' AS STATUS FROM DUAL )
SELECT A.ID, B.STATUS, NVL(A.CNT, 0)
FROM B LEFT OUTER JOIN A PARTITION BY (A.ID) ON (A.STATUS = B.STATUS)