Your question, your audience. Choose who sees your identity—and your question—with question security.
create table mt (id integer, data varchar2(200), dt date);
create table dt (id integer, data varchar2(200), dt_start date, dt_end date);
insert into mt select 1, 'a', trunc(sysdate-10) from dual;
insert into mt select 2, 'b', trunc(sysdate-5) from dual;
insert into mt select 3, 'c', trunc(sysdate-1) from dual;
insert into dt select 1, 'a1', trunc(sysdate-11), trunc(sysdate-9) from dual;
insert into dt select 2, 'a2', trunc(sysdate-10), trunc(sysdate-8) from dual;
insert into dt select 3, 'b1', trunc(sysdate-6), trunc(sysdate-4) from dual;
insert into dt select 4, 'd1', trunc(sysdate-3), trunc(sysdate-2) from dual;
select mt.id, mt.data, mt.dt, dt.id detail_id, dt.data detail_data, dt.dt_start, dt.dt_end
from mt, dt
where mt.dt between dt.dt_start and dt.dt_end;
select mt.id, mt.data, mt.dt, dt.id detail_id, dt.data detail_data, dt.dt_start, dt.dt_end
from mt, dt
where mt.dt between dt.dt_start(+) and dt.dt_end(+);
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Join the community of 500,000 technology professionals and ask your questions.