首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

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

2012-05-21 
求思路 分组求最大值数据:a,1a,2a,3b,2b,1想求出 a.3,b,2的数据[解决办法]SQL code或者select * from test

求思路 分组求最大值
数据:
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) 

热点排行