• I disagree with Grumpy's first suggestion. Oracle may not "need" the AS for a table alias (and neither does SQL Server), but including it in my opinion greatly increases readability and maintainability of the code.

    UPDATE ... FROM is a SQL Server only construction, not supported by the ANSI standard, or by most other DBMSes. (And for good reasons, it has some very dangerous and often overlooked effects).

    The ANSI compliant way to write this kind of update would be:

    UPDATE FGMULTI

    SET NON_CONFORM_ALLOCATABLE = 'Y'

    WHERE EXISTS

    (SELECT *

    FROM fgmulti as fg

    LEFT OUTER JOIN

    arinvt as ar ON fg.arinvt_id = ar.id

    WHERE (something) = FGMULTI.(SomeColumn)

    AND (other conditions));

    I cannot provide more specific help then this. Your code lacks aliases for the columns (which in my opinion is a bad practice - the DBMS may know which column it is, but you have to spend time on it every time you look at the query). So I do not know which condition references which tables in your original code.


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/