with DateRowCount(col1,CountRows)
as
(
select col1,COUNT(col1)
over (partition by col1) from table1 as CountRows
)
select col1, CountRows
from DateRowCount
group by col1, CountRows
order by col1
as
(
select col1,COUNT(col1)
over (partition by col1) from table1 as CountRows
)
select col1, CountRows
from DateRowCount
group by col1, CountRows
order by col1