当前位置: 代码迷 >> Sql Server >> 求思路 分组求最大值解决办法
  详细解决方案

求思路 分组求最大值解决办法

热度:43   发布时间:2016-04-27 12:47:16.0
求思路 分组求最大值
数据:
a,1
a,2
a,3
b,2
b,1


想求出 a.3,b,2的数据

------解决方案--------------------
SQL code
或者select * from test awhere a.col2=(select max(col2) from test b where a.col1=b.col2)
  相关解决方案