分组依据一列数据的最大或者最小值查询查询其余列对应数据

   
   select * from ( select ROW_NUMBER() over(partition  by ProductTypeID  order by SortCode  desc  ) rum,* from dbo.T_ProductType_Img img where img.IsDelete='False' 
    ) tem where rum=1
相关文章
相关标签/搜索