Left join a query result to a table

  • Move it into the ON clause so it only affects the left join population instead of the result population.

    When dealing with outer joins, think of it this way:

    Criteria in the ON component happen before linking the data to the main dataset.

    Criteria in the WHERE component happen after the result is built and then removes from the results.


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

Viewing post 1 (of 2 total)

You must be logged in to reply to this topic. Login to reply