[Sqlalchemy-tickets] Issue #4076: oracle 8 / non-ansi joins needs to apply (+) to all occurences of
Brought to you by:
zzzeek
From: Michael B. <iss...@bi...> - 2017-09-13 18:50:47
|
New issue 4076: oracle 8 / non-ansi joins needs to apply (+) to all occurences of the right hand table https://bitbucket.org/zzzeek/sqlalchemy/issues/4076/oracle-8-non-ansi-joins-needs-to-apply-to Michael Bayer: https://docs.oracle.com/database/121/SQLRF/queries006.htm#SQLRF52354 "apply the outer join operator (+) to all columns of B in the join condition in the WHERE clause" ``` #!python from sqlalchemy import and_ from sqlalchemy import table, column from sqlalchemy import select from sqlalchemy.dialects import oracle a = table('a', column('x'), column('y')) b = table('b', column('q'), column('p')) stmt = select([a]).select_from(a.outerjoin(b, and_(a.c.x > b.c.q, b.c.p == None))) print stmt.compile(dialect=oracle.dialect(use_ansi=False)) ``` ``` #! SELECT a.x, a.y FROM a, b WHERE a.x > b.q AND b.p IS NULL ``` |