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

  • Home
  • SEARCH
  • 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 7978557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:31:20+00:00 2026-06-04T09:31:20+00:00

So, I am not sure what the best way to do a join for

  • 0

So, I am not sure what the best way to do a join for these tables was. I want to use a JOIN because I believe it is faster than bring all three of the tables in on FROM. So, if i have three tables…

Table1
--id
--data

Table2
--id
--data

Table1_Table2
--table1_id
--table2_id

How can I do a join for this data using the join table?

  • 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-04T09:31:22+00:00Added an answer on June 4, 2026 at 9:31 am

    Mentioning all tables in the FROM clause is also a join, implicit one. It is not recommended to use it as it might lead to a Cartesian product of the tables involved in case you’ll forget to add predicates in the WHERE clause.

    Have a look on the Wikipedia JOIN article and also at this very nice blogpost about joins by Jeff Atwood.

    I think that you’re interested in the INNER JOIN between the tables, although other variants exists. Try this:

    SELECT t1.*, t2.*
      FROM Table1 t1
      INNER JOIN Table1_Table2 tt ON t1.id = tt.table1_id
      INNER JOIN Table2 t2 ON t2.id = tt.table2_id;
    

    I skipped Table1_Table2 columns from the select list, as there’s nothing special there.

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

Sidebar

Related Questions

As you can probably tell by the title, I'm not sure the best way
I'm not sure what the best way to avoid duplicate markers on a Google
So I'm not sure what the best way to accomplish this is, but basically
I'm new to MVC (MVC3) so not sure about the best way to implement
I'm not sure what is the best way to unsubscribe from a channel when
I'm not sure if this is the best way to do it, but I
I am not sure if I am going about this the best way, but
I'm not entirely sure if this is the best way to word it, however,
I'm not sure the best way to design this, so here goes: I'm tracking
I'm not sure the best way to describe what it is that I'm trying

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.