SQL 表分组后取各个分组的第一条数据
SELECT ROW_NUMBER()OVER(PARTITION By GroupId ORDER BY GroupId ) CN, * FROM T_DIM_SENSOR_GROUP
select * from (
SELECT ROW_NUMBER()OVER(PARTITION By GroupId ORDER BY GroupId ) Cu, * FROM T_DIM_SENSOR_GROUP
) t where t.Cu<2