56,677
社区成员
发帖
与我相关
我的任务
分享
select *
from table1 a
where (`TIME`<now() and not exists (select 1 from table1 where `TIME`<now() and `TIME`>a.`TIME`))
or (`TIME`>now() and not exists (select 1 from table1 where `TIME`>now() and `TIME`<a.`TIME`))