Obojí můžete provést v jednom dotazu pomocí klauzule OVER v jiném COUNT
select
count(*) RecordsPerGroup,
COUNT(*) OVER () AS TotalRecords
from temptable
group by column_1, column_2, column_3, column_4
Obojí můžete provést v jednom dotazu pomocí klauzule OVER v jiném COUNT
select
count(*) RecordsPerGroup,
COUNT(*) OVER () AS TotalRecords
from temptable
group by column_1, column_2, column_3, column_4