sql 分组 每一组的第一个

 select * from (SELECT  CN,row_number() over (PARTITION BY CN ORDER BY EN Desc) AS RN ,EN
  FROM [NameMap])b where b.RN=1

你可能感兴趣的:(sql,server,sql,数据库)