Oracle Table alias in join

Monday, May 12, 2014

is it possible to use the table alias in an ON-Statement?


SQL Statement:



SELECT XMLELEMENT("row", XMLATTRIBUTES(rownum as "order"),
(
SELECT
XMLAGG(XMLELEMENT("attribute"),XMLATTRIBUTES(z as "identifier") ) )
FROM b
LEFT JOIN c
ON c.ID = b.cID
AND c.example = table_alias.example
)
)
FROM
(
SELECT example FROM x ORDER BY y
) table_alias


I'm getting the error that table_alias.example is an invalid identifier. If I move the c.example = table_alias.example into a WHERE Statement it works, but of course I'll get the wrong result.


Anyone have an idea?


TY frgtv10







http://ift.tt/1lbe9Sj