Home Forums SQL Server 2012 SQL 2012 - General LEFT JOIN without predicate , still works but what is that?<!-- 864 --><!-- 864 --> RE: LEFT JOIN without predicate , still works but what is that?<!-- 864 --><!-- 864 -->

  • mario17 (8/21/2014)


    <<What it's saying is that IF the Left join row exists , INNER join to that other table.

    Otherwise, treat it like a regular LEFT join and put NULL in the JOINED columns.>>

    Just got feedback from one top notch pro like above on that, so it's OK. It's definetely works and works very fast.

    Sorry Jack, didn't get what good or worse in this case?

    Thanks

    M

    The example you posted doesn't compile. I get:

    Msg 102, Level 15, State 1, Line 11

    Incorrect syntax near 'LogID'.

    When trying to parse the query. I've also tried this:

    SELECT

    *

    FROM

    sys.tables AS T

    LEFT JOIN sys.columns AS C

    JOIN sys.index_columns AS IC

    ON C.column_id = IC.column_id

    To make sure the issue wasn't related to non-existent objects and I still get the same error. So I'm not sure how the code as presented could work.