Select
resource_fk_key,sum(cost) cost, count(*) total_entries, Count(cost) num_entries
from
mth_resource_cost
where iscurrent=1
group by resource_fk_key
View Text - HTML Formatted
SELECT
RESOURCE_FK_KEY , SUM(COST) COST , COUNT(*) TOTAL_ENTRIES , COUNT(COST) NUM_ENTRIES
FROM
MTH_RESOURCE_COST
WHERE ISCURRENT=1
GROUP BY RESOURCE_FK_KEY