Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.
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(+);
If you are experiencing a similar issue, please ask a related question
Title | # Comments | Views | Activity |
---|---|---|---|
SQL Server 2012 rs - Field1 and Field2 add 1 to Total | 4 | 18 | |
Select only the top record in a left join | 13 | 35 | |
dbms_crypto.decrypt errors out | 6 | 31 | |
Query Syntax | 17 | 34 |
Join the community of 500,000 technology professionals and ask your questions.