想请教下在oracle中如何实现获取一张表中,设定开始时间和结束时间,并 ...
发布网友
发布时间:2022-04-26 00:01
我来回答
共1个回答
热心网友
时间:2022-04-08 07:42
建表和插入数据
create table table_a( t1 date, t2 date);
insert into table_a values(to_date('20140501','yyyymmdd') ,to_date('20140503','yyyymmdd'));
insert into table_a values(to_date('20140508','yyyymmdd') ,to_date('20140509','yyyymmdd'));
create table table_b(t date,id int)
insert into table_b values(to_date('20140501','yyyymmdd'),1);
insert into table_b values(to_date('20140502','yyyymmdd'),2);
insert into table_b values(to_date('20140503','yyyymmdd'),3);
insert into table_b values(to_date('20140504','yyyymmdd'),4);
insert into table_b values(to_date('20140505','yyyymmdd'),5);
insert into table_b values(to_date('20140506','yyyymmdd'),6);
insert into table_b values(to_date('20140507','yyyymmdd'),7);
insert into table_b values(to_date('20140508','yyyymmdd'),8);
insert into table_b values(to_date('20140509','yyyymmdd'),9);
insert into table_b values(to_date('20140510','yyyymmdd'),10);
insert into table_b values(to_date('20140511','yyyymmdd'),11);