select , from tablename as a w;ere exists select 2 from tablename as b where 条件,要排除掉本条记录
select * from 现在有一批数据 t where exists (select 1 from 现在有一批数据 where 司机CD=t.司机CD and 车号=t.车号 and 发车日=t.发车日 and 发车时刻<>t.发车时刻 and 发车时刻-t.发车时刻 between -60/60/24 and 60/60/24)
from 现在有一批数据 t
where exists (select 1 from 现在有一批数据 where 司机CD=t.司机CD and 车号=t.车号 and 发车日=t.发车日 and 发车时刻<>t.发车时刻 and 发车时刻-t.发车时刻 between -60/60/24 and 60/60/24)