WITH LR AS
(select LC.id,LC.date
from LeaveCountry LC,
(select id,count(*)
from LeaveCountry
where date between sysdate and sysdate-730
group by id
having count(*)>=4) LI
where LC.id=LI.id
)
select id,date
from LR
minus
select distinct a.id,a.date
from LR a, LR b
where a.id=b.id
and a.date<>b.date
and abs(a.date-b.date)<30
没测试过,只是大概思路.