17,082
社区成员
发帖
与我相关
我的任务
分享
with A as(
select to_date('2010-07-22 10:20:18','yyyy-mm-dd hh24:mi:ss') t1 from dual
union all
select to_date('2010-07-22 10:20:19','yyyy-mm-dd hh24:mi:ss') t1 from dual
union all
select to_date('2010-07-22 10:20:25','yyyy-mm-dd hh24:mi:ss') t1 from dual
union all
select to_date('2010-07-22 10:20:26','yyyy-mm-dd hh24:mi:ss') t1 from dual
),B as(
select to_date('2010-07-22 10:20:20','yyyy-mm-dd hh24:mi:ss') t2 from dual
union all
select to_date('2010-07-22 10:20:27','yyyy-mm-dd hh24:mi:ss') t2 from dual
)
select t1 from A,B where abs((t2-t1)*24*60*60) < 2
a.dt=(b.dt-interval '1' second)