If it is the '(+)', this is the old Oracle Outer Join syntax.
I've never seen it used the way you posted but it looks like it is valid syntax:
http://asktom.oracle.com/p
You shouldn't need if with a variable and table columns.
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(+);
Title | # Comments | Views | Activity |
---|---|---|---|
T-SQL Convert to PL/SQL | 23 | 62 | |
SQL Server R2 Stored procedure make faster | 7 | 32 | |
export Oracle diagram from Oracle DB including VIEWS | 8 | 64 | |
Unable to insert second line output line in ODBC connection | 4 | 32 |
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
19 Experts available now in Live!