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 7676445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:12:05+00:00 2026-05-31T17:12:05+00:00

Whats the difference between using a LEFT OUTER JOIN , rather than a sub-query

  • 0

Whats the difference between using a LEFT OUTER JOIN, rather than a sub-query that starts with a WHERE NOT EXISTS (...)?

  • 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-05-31T17:12:06+00:00Added an answer on May 31, 2026 at 5:12 pm

    No they are not the same thing, as they will not return the same rowset in the most simplistic use case.

    The LEFT OUTER JOIN will return all rows from the left table, both where rows exist in the related table and where they does not. The WHERE NOT EXISTS() subquery will only return rows where the relationship is not met.

    However, if you did a LEFT OUTER JOIN and looked for IS NULL on the foreign key column in the WHERE clause, you can make equivalent behavior to the WHERE NOT EXISTS.

    For example this:

    SELECT 
      t_main.*
    FROM 
       t_main
       LEFT OUTER JOIN t_related ON t_main.id = t_related.id
    /* IS NULL in the WHERE clause */
    WHERE t_related.id IS NULL
    

    Is equivalent to this:

    SELECT
      t_main.*
    FROM t_main 
    WHERE 
      NOT EXISTS (
        SELECT t_related.id 
        FROM t_related 
        WHERE t_main.id = t_related.id
      )
    

    But this one is not equivalent:

    It will return rows from t_main both having and not having related rows in t_related.

    SELECT 
      t_main.*
    FROM
      t_main
      LEFT OUTER JOIN t_related ON t_main.id = t_related.id
    /* WHERE clause does not exclude NULL foreign keys */
    

    Note This does not speak to how the queries are compiled and executed, which differs as well — this only addresses a comparison of the rowsets they return.

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

Sidebar

Related Questions

What is the difference between using top and left properties and top and left
what's the difference between using a js library like jquery and using an ajax
What is the difference between using the OnClick attribute of an ASP.Net Button: <asp:Button
What is the difference between using an environment variable, like PATH, as $PATH or
In PHP what is the difference between using \1 or $1 as $replacement in
In PHP 5, what is the difference between using const and static ? When
What's the difference between reading a value from an SqlDataReader using this syntax: Dim
Using Silverlight 3 with RIA: What's the difference between the LoadOperation.Completed event and using
What's the point using this syntax div.card > div.name What's the difference between this
What is the difference between passing-by-reference and using the C pointer notation? void some_function(some_type&

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.