34,576
社区成员
发帖
与我相关
我的任务
分享
--1
select * from tb a
where not exists( select 1 from tb where [count]=t.[count] and id<t.id)
--2
select * from tb a where id=(select id from tb where [count]=t.[count])
select *
from tb t
where id=(select min(id) from tb where [count]=t.[count])
SELECT *
FROM TB T1
WHERE NOT EXISTS(
SELECT 1 FROM TB T2 WHERE T2.COUNT=T1.COUNT AND T2.ID<T1.ID
)