34,590
社区成员
发帖
与我相关
我的任务
分享
---1
select * from tab a
where not exists(select 1 from tab where a.a=a and a.b>b )
---2
select a.* from tab a,(select a,min(b) as b from tab group by a) b
where a.a=b.a and a.b=b.b
--3
select a,(select min(b) from tab where a.a=a) as b from tab a
SELECT * FROM TableName AS A
WHERE NOT EXISTS(SELECT 1 FROM TableName AS B WHERE A.A=B.A AND B.B<A.B)
SELECT * FROM TableName AS A
WHERE NOT EXISTS(SELECT 1 FROM TableName AS B WHERE A.A=B.A AND B.B>A.B)
select A,D,min(B) as Bselect A,D,min(B) as B
from 表名
group by A
select A,min(B) as B
from 表名
group by A