How do I count the number of records returned by a group by query,
For eg:
select count(*) from temptable group by column_1, column_2, column_3, co
Try this query:
select top 1 TotalRows = count(*) over () from yourTable group by column1, column2