34,575
社区成员
发帖
与我相关
我的任务
分享
是分组求最大还是单个求最大?
如果是分组的话:
select * from tb t where 年龄=(select max(年龄) from tb where id=t.id)
select top 1 * from tb order by 年龄 desc
--or
select * from tb where 年龄=(select max(年龄) from tb)
--楼主 问题够精炼
select top 1 * from tb order by 年龄 desc
--or
select * from tb t where 年龄=(select max(年龄) from tb where id=t.id)