magritton
6/20/2015 - 11:51 PM

SQL Partition, find the number of rows in each partition

SQL Partition, find the number of rows in each partition

SELECT $PARTITION.RandomData_Range(somedatetime)  AS PARTITIONID,
       COUNT(* )                                   AS ROW_COUNT
FROM     DBO.RandomData_Parted
GROUP BY $PARTITION.RandomData_Range(somedatetime)
ORDER BY PARTITIONID