Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8210839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:13:05+00:00 2026-06-07T10:13:05+00:00

Take a typical left outer join scenario. We all know that the order of

  • 0

Take a typical left outer join scenario. We all know that the order of the tables is quite significant, e.g., Q1 and Q2 are not equivalent:

SELECT A.x, B.y FROM A LEFT OUTER JOIN B ON A.id = B.id -- (Q1)
SELECT A.x, B.y FROM B LEFT OUTER JOIN A ON B.id = A.id -- (Q2)

When I think conceptually about multiple joins it usually seems natural to me to imagine picking up the new table as the object of interest and then describing how its rows are related to what’s come before. Keeping the terms in parallel doesn’t have any advantage to me and by my own habit I generally write the join condition this way:

SELECT A.x, B.y FROM A LEFT OUTER JOIN B ON B.id = A.id -- (Q3)

I had a conversation with a former coworker who misunderstood how the syntax works. To this coworker, Q3 was wrong and Q1 was right. And I do recognize that with the old-style outer join syntax this would matter and that’s likely the source of this confusion. I’ve never heard or seen anyone else make this case using ANSI joins. Please answer this question and redeem my reputation, point out something I’ve overlooked, or offer deeper insight into the erroneous perspective.

Does the order of expressions or predicates make any difference in the join condition for outer joins in standard SQL with ANSI joins?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T10:13:07+00:00Added an answer on June 7, 2026 at 10:13 am

    No, it makes no difference.

    Personally I prefer the style that you show in Q3, some of my workmates prefer the style in Q1. I don’t know anyone who would ever consider either of them to be wrong.

    The query optimiser turns the query inside out into something completely different, so the predicate doesn’t even exist as a plain comparison any more when it’s done with it. Usually it’s a lookup in an index or a table, and as that can only be done in one direction, how the predicate was written makes no difference.

    I checked (in SQL Server 2005) the execution plan of two queries with the predicate operands in different order, and as expected they are identical.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider this typical disconnected scenario: load a Customer object from SQL Server using LINQ
Take the typical demonstration of how pointer values can change through casting : struct
I'm building a business application which mostly involves tables and other typical form elements.
I have a page I am building that will take 'contacts' that I have
I wrote a simple webform that will take the user's information (via POST) and
I'm wondering what would be the typical scenario for using an end-user report designer.
We all have come across web pages which take some time to show the
I've got a JavaScript application that uses a lot of callbacks. A typical function
I have an asp.net application that utilizes long polling. So, a typical call to
Having created a functional test project using nHibernate with all the typical trimmings I've

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.