sqloracle-databaseleft-joinora-00936

ORA 00936 error while using left outer join + syntax


I have two tables: T1 and T2

I want to left outer join T1 and T2 with join condition:

trunc(CT1,'Mi')=trunc(CT2,'Mi')(+)

When I try to run this SQL, I receive error ORA 00936:missing expression.

Any idea what is wrong here?


Solution

  • I think that you need to put the (+) operator immediately after the column name that it applies to.

    trunc(CT1,'Mi')=trunc(CT2 (+),'Mi')
    

    "The (+) operator can be applied only to a column, not to an arbitrary expression. However, an arbitrary expression can contain one or more columns marked with the (+) operator." (from http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm)

    In any case, I would suggest using the ANSI syntax. It's clearer, more functional, and portable.