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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:37:50+00:00 2026-05-28T15:37:50+00:00

Is it possible to select multiple tables and make inner join on one of

  • 0

Is it possible to select multiple tables and make inner join on one of those tables? e.g.

SELECT * 
FROM table1 AS t1, table2 AS t2, table3 AS t3
INNER JOIN table4 AS t4 ON t1.row3 = t4.row3
INNER JOIN table5 AS t5 ON t1.row4 = t5.row4
WHERE ...

This paricular case is causing me a problem. it gives me an error – Unknown column “t1.row3” in ‘on clause’. I don’t know if it’s possible to select multiple tables but make inner join on one of those tables.

  • 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-28T15:37:51+00:00Added an answer on May 28, 2026 at 3:37 pm

    The JOIN operand has higher precedence than comma , operand, so the join is effectively treated as

    t1, t2, (t3, t4, t5 ON ... )
    

    Put parentheses around t1, t2, t3.

    SELECT * 
    FROM  ( table1 AS t1, table2 AS t2, table3 AS t3 )
    INNER JOIN table4 AS t4 ON t1.row3 = t4.row3
    INNER JOIN table5 AS t5 ON t1.row4 = t5.row4
    WHERE ...
    

    You can also write your query as:

    SELECT * 
    FROM  table1 AS t1
    INNER JOIN table2 AS t2
    INNER JOIN table3 AS t3
    INNER JOIN table4 AS t4 ON t1.row3 = t4.row3
    INNER JOIN table5 AS t5 ON t1.row4 = t5.row4
    WHERE ...
    

    because comma is equivalent to INNER JOIN without a join condition.

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

Sidebar

Related Questions

Possible Duplicate: SQL - how to SELECT multiple tables and JOIN multiple rows from
Possible Duplicate: SQL left join vs multiple tables on FROM line? SELECT messages.message_title, messages.message_content,
is it possible to be able Multiple select files when make browse file? any
I understand that you can select multiple columns from multiple tables by using joins.
I have multiple select statements from different tables on the same database. I was
I'm wondering if it's possible to use a wildcard to select multiple cookies. I'm
There are three tables, Students, Classes, Student_Class Is it possible to select students who
Due to a need to join multiple tables in a single query, I am
Is it possible to have selective queries in PostgreSQL which select different tables/columns based
I wanted to know if it was possible to make a select on a

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.