1、创建测试表,
create table test_date_bet(id varchar2(20),v_date date);
2、插入测试数据;
insert into test_date_bet values(1, sysdate-100);
insert into test_date_bet values(2, sysdate-10);
insert into test_date_bet values(3, sysdate-5);
insert into test_date_bet values(4, sysdate);
insert into test_date_bet values(5, sysdate-4);
commit;
3、查询表中全量数据;select t.*, rowid from test_date_bet t;
4、编写语句,查询sydate-5与sydate之间的记录;
select t.*, rowid sec from test_date_bet t where v_date between sysdate-5 and sysdate;