7,714
社区成员
发帖
与我相关
我的任务
分享
select a.*
from buker19999 a inner join (
select id,max(record) as m_record
from buker19999
where Record>=2 and A='k'
group by id
) b on a.id=b.id and a.record = b.m_record
select a.*
from buker19999 a inner join (
select id,max(record) as m_record
from buker19999
where Record>=2 and B='b'
group by id
) b on a.id=b.id and a.record = b.m_record
select a.*
from buker19999 a inner join (
select id, max(record) as m_record
from buker19999
where record>2 and a=b
group by id)
) b on a.id=b.id and a.record = b.=m_record
select a.*
from buker19999 a inner join (
select id, max(record) as m_record
from buker19999
where record>2
group by id)
) b on a.id=b.id and a.record = b.=m_record
select * from buker19999 t
where record>2
and not exists (
select 1 from buker19999
where id=t.id and record>t.record
)