select *
from quit_memb a
where not exists(select 1 from quit_memb where mobile=a.mobile and contentid=a.contentid
and quittime>a.quittime)
from quit_memb a
where not exists(select 1 from quit_memb where mobile=a.mobile and contentid=a.contentid
and quittime>a.quittime)
union
select contentid ,count(*),max(quittime) from Quit_memb group by contentid having count(*)=1应该可以有更简单的方法。这个写法比较复杂。执行效率不好。