Я не на 100% уверен в ваших требованиях, однако это может дать вам некоторые идеи о том, как делать то, что вам нужно. Например, вы сказали ровно 2; Что делать, если есть 3 случая? и т.д.
create table t (ident varchar2(16), occurance timestamp);
insert into t (ident, occurance) values ('a', to_date('20080101000000', 'yyyymmddhh24miss'));
insert into t (ident, occurance) values ('b', to_date('20080101010000', 'yyyymmddhh24miss'));
insert into t (ident, occurance) values ('a', to_date('20080101115900', 'yyyymmddhh24miss'));
insert into t (ident, occurance) values ('c', to_date('20080102000000', 'yyyymmddhh24miss'));
insert into t (ident, occurance) values ('d', to_date('20080102010000', 'yyyymmddhh24miss'));
insert into t (ident, occurance) values ('d', to_date('20080102200000', 'yyyymmddhh24miss'));
insert into t (ident, occurance) values ('d', to_date('20080103020000', 'yyyymmddhh24miss'));
select ident, occurance
from
(
select ident, occurance,
lag(occurance) over (partition by ident order by occurance) previous,
lead(occurance) over (partition by ident order by occurance) next
from t
)
where
((occurance-previous<interval'12:00' hour to minute and extract(day from occurance) = extract(day from previous))
or (next-occurance<interval'12:00' hour to minute and extract(day from occurance) = extract(day from next)))
/