SQL 分組後獲取其中一個字段最大值的整條記錄

123717408.gif


select * from (  

select id,name,counts,createDate,row_number() over(partition bynameorderby createDate desc) rn  

from testTable  

) t where t.rn <=1  

123731982.png


http://shop107857222.taobao.com/


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章