select * from table_name
where abs(column_name-to_date('20081220','yyyymmdd')) in (
select min(abs(column_name-to_date('20081220','yyyymmdd'))) from
table_name
)
例:
select * from (select * from table where 条件)
where abs(to_date(substr(starttime,0,8),'yyyymmdd')-to_date('20180101','yyyymmdd')) in (
select min(abs(to_date(substr(starttime,0,8),'yyyymmdd')-to_date('20180101','yyyymmdd'))) from
(select *
from table
where 条件))