How to "group by" the result of a query with sub-queries
Hello,
I'm a bit struggling with this SQL statement and the "Group By" function:
the following SQL works (no group by):
-- Main Query:
select TO_CHAR(AST.CREATED, 'YYYY MM') as "Month Created",
-- Subquery 1:
(select COUNT(AST1.ROW_ID)
from SIEBEL.S_ASSET AST1
where AST1.ROW_ID = AST.ROW_ID
AND AST1.CREATED_BY = '1-1P211C') as "Bonus given by EIM",
-- Subquery 2:
(select COUNT(AST2.ROW_ID)
from SIEBEL.S_ASSET AST2
where AST2.ROW_ID = AST.ROW_ID
AND AST2.CREATED_BY = '0-1') as "Bonus given by SADMIN"
from SIEBEL.S_ASSET AST