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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:33:51+00:00 2026-05-31T14:33:51+00:00

I feel like I was always taught to use LEFT JOIN s and I

  • 0

I feel like I was always taught to use LEFT JOINs and I often see them mixed with INNERs to accomplish the same type of query throughout several pieces of code that are supposed to do the same thing on different pages. Here goes:

SELECT ac.reac, pt.pt_name, soc.soc_name, pt.pt_soc_code
FROM
  AECounts ac
  INNER JOIN 1_low_level_term llt on ac.reac = llt.llt_name
  LEFT JOIN 1_pref_term pt ON llt.pt_code = pt.pt_code
  LEFT JOIN 1_soc_term soc ON pt.pt_soc_code = soc.soc_code
LIMIT 100,10000

Thats one I am working on:

I see a lot like:

SELECT COUNT(DISTINCT p.`case`) as count
FROM FDA_CaseReports cr
  INNER JOIN ae_indi i ON i.isr = cr.isr
  LEFT JOIN ae_case_profile p ON cr.isr = p.isr

This seems like the LEFT may as well be INNER is there any catch?

  • 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-31T14:33:53+00:00Added an answer on May 31, 2026 at 2:33 pm

    Is there any catch? Yes there is — left joins are a form of outer join, while inner joins are a form of, well, inner join.

    Here’s examples that show the difference. We’ll start with the base data:

    mysql> select * from j1;
    +----+------------+
    | id | thing      |
    +----+------------+
    |  1 | hi         |
    |  2 | hello      |
    |  3 | guten tag  |
    |  4 | ciao       |
    |  5 | buongiorno |
    +----+------------+
    
    mysql> select * from j2;
    +----+-----------+
    | id | thing     |
    +----+-----------+
    |  1 | bye       |
    |  3 | tschau    |
    |  4 | au revoir |
    |  6 | so long   |
    |  7 | tschuessi |
    +----+-----------+
    

    And here we’ll see the difference between an inner join and a left join:

    mysql> select * from j1 inner join j2 on j1.id = j2.id;
    +----+-----------+----+-----------+
    | id | thing     | id | thing     |
    +----+-----------+----+-----------+
    |  1 | hi        |  1 | bye       |
    |  3 | guten tag |  3 | tschau    |
    |  4 | ciao      |  4 | au revoir |
    +----+-----------+----+-----------+
    

    Hmm, 3 rows.

    mysql> select * from j1 left join j2 on j1.id = j2.id;
    +----+------------+------+-----------+
    | id | thing      | id   | thing     |
    +----+------------+------+-----------+
    |  1 | hi         |    1 | bye       |
    |  2 | hello      | NULL | NULL      |
    |  3 | guten tag  |    3 | tschau    |
    |  4 | ciao       |    4 | au revoir |
    |  5 | buongiorno | NULL | NULL      |
    +----+------------+------+-----------+
    

    Wow, 5 rows! What happened?

    Outer joins such as left join preserve rows that don’t match — so rows with id 2 and 5 are preserved by the left join query. The remaining columns are filled in with NULL.

    In other words, left and inner joins are not interchangeable.

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

Sidebar

Related Questions

I feel like I'm taking crazy pills here. Usually there's always a million library
I feel like this is a silly question but I always find that modifying
I feel like I'm unprofessional in the way I name and use iterators. What
I feel like I'm always stumbling over the language used to distinguish between an
When I start to learn a new language, I always feel like I'm not
I feel like I am always reinventing the wheel for each application when it
I know some solutions to this, but I feel like I'm always taking a
This problem has bugged me for years, and I always feel like I'm coming
I feel like a moron having to ask this, but I have always evaded
I don't always write Regular Expressions, but when I do, I feel like I'm

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.