select * from sales_table where day_field between to_number(to_char(sysdate - 7, 'yyyymmdd')) and to_number(to_char(sysdate, 'yyyymmdd'))
其中,day_cd 形如 20181123,若day_cd 形如 2018-11-23,则为如下语句:
select * from sales_table where day_field between to_number(to_char(sysdate - 7, 'yyyy-mm-dd')) and to_number(to_char(sysdate, 'yyyy-mm-dd'))