Record counts by source select AR.SOURCE_FK, COUNT(*), A_S.SOURCE_IDENTIFIER, A_S.SHORT_CODE from AGGR_RESOURCE AR, AGGR_SOURCE A_S where AR.SOURCE_FK = A_S.ID group by SOURCE_FK;