select a,last_note_user,c,d,iso_src
from X,Y,Z
left outer join W
ON (W.last_note_user=Z.userid AND W.user_ten=Y.iso_src)
when I am executing the ab
It's probably a good habit to not mix ANSI and non-ANSI join syntax as the other responses indicate. However, it is technically possible, by isolating the non-ANSI joins into a subquery:
create table X as (select dummy a, dummy c, dummy d from dual);
create table Y as (select dummy iso_src from dual);
create table Z as (select dummy userid from dual);
create table W as (select dummy last_note_user, dummy user_ten from dual);
select a,last_note_user,c,d,iso_src
from (select a, c, d, iso_src, userid FROM X,Y,Z) xyz
left outer join W
ON (W.last_note_user=xyz.userid AND W.user_ten=xyz.iso_src);
A LAST_NOTE_USER C D ISO_SRC
- -------------- - - -------
X X X X X
1 rows selected
You cannot mix JOIN
syntaxes in Oracle
this way.
A JOIN
condition can only refer tables previously joined using ANSI JOIN
syntax.
Use this:
SELECT a, last_note_user, c, d, iso_src
FROM X
CROSS JOIN
Y
CROSS JOIN
Z
LEFT OUTER JOIN
W
ON W.last_note_user = Z.userid
AND W.user_ten = Y.iso_src