前后共30天:
select *
from
表名
where
时间字段
between
to_date(sysdate-15,
'yyyy-mm-dd'
)
and
to_date(sysdate+15,
'yyyy-mm-dd'
);
前30天:
select *
from
表名
where
时间字段
between
to_date(sysdate-30,
'yyyy-mm-dd'
)
and
to_date(sysdate,
'yyyy-mm-dd'
);
后30天:
select *
from
表名
where
时间字段
between
to_date(sysdate,
'yyyy-mm-dd'
)
and
to_date(sysdate+30,
'yyyy-mm-dd'
);