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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:12:12+00:00 2026-06-11T11:12:12+00:00

What is the use of a left join(or for that matter maybe even inner

  • 0

What is the use of a left join(or for that matter maybe even inner join) if one can simply write a full outer join like so

playorm=# select * from trade as a full outer join Account as b on b.id=a.accoun
tid where a.id = a.id;

This ends up returning all the same results an LEFT inner join would return.

or if you want an inner join, you can do this

playorm=# select * from trade as a full outer join Account as b on b.id=a.accoun
tid where a.id = a.id AND b.id = b.id;

This ends up returning all the same results an INNER JOIN would return.

I just thought this was kind of interesting is all I guess. I originally mistaking thought a left outer join would return nulls + what the conditions matched but found out the conditions have to match which is kind of weird as in this inner join eliminates records that match(probably because join is done before expression matching so the a.accountid is null is a useless part of the where clause…

select * from trade as a inner join Account as b on b.id=a.accountid
here (b.isActive=false OR a.accountid is null) and a.number < 15;

later,
Dean

  • 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-11T11:12:13+00:00Added an answer on June 11, 2026 at 11:12 am

    I’m not quite sure of the intent of your question. Do you mean “Why does SQL support syntax for left-outer-join when it’s easy to use syntax for full-outer-join with an extra xxx is not null condition?” In other words, does left-outer-join appear to be unnecessary syntactic sugar?

    Answer: You use syntactic sugar to make your meaning clearer to someone else who reads your code. For example imagine a school has a table of students and a table of courses. If you want to see a list of students and what courses they have passed, including students who have not passed anything, then left outer join makes that intention clear. If I see a full outer join in your code, I might assume you are also interested in courses that nobody has passed. It would take a little digging into your code to find that clause among the conditions that filters out those non-matching courses.

    Programmers like me are often time-squeezed so they won’t dig into your code as deeply as might be ideal, so please give hints to help us understand your intent. Use synactic sugar to sweeten the professional lives of your colleagues.

    By the way, you state that “inner join eliminates records that match”. Don’t you mean that “inner join eliminates records that do not match in the other table”? Actually, you are better off to think of inner join as returning all matching records, and left/right/full outer joins as supplementing the innner join with non-matched records from the first/second/both tables.

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

Sidebar

Related Questions

I know that can't use left join in indexed view. but I don't understand
At http://dev.mysql.com/doc/refman/5.5/en/left-join-optimization.html one can read: If you use LEFT JOIN to find rows that
I am going to try to use left outer join between Ticket and Membership.
Is it true that no matter which type of join you use, if your
I feel like I was always taught to use LEFT JOIN s and I
I have to write a LEFT JOIN query of find the records that do
When I use left outer join with order by in the below query the
Outer joins don't seem to work whether I use a left outer join or
We are having a debate in our company. I use left outer joins quit
In an activity we can use getIntent() to get coordinates of top and left

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.