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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:46:47+00:00 2026-05-25T10:46:47+00:00

I am not too familiar with SQL, but I need to select from 3

  • 0

I am not too familiar with SQL, but I need to select from 3 tables.

I can go:

SELECT * FROM tbl1, tbl2, tbl3 WHERE ID=3

but there is a chance that tbl3 is does not have any rows with ID 3, and chances are that tbl1 has a few.

tbl2 should have only one row.

I would still like to get the rows in the other tables.

How can I accomplish this ?

Thanks up ahead!

  • 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-25T10:46:47+00:00Added an answer on May 25, 2026 at 10:46 am

    How do the three tables relate? The condition ‘WHERE ID=3’ is a little ambiguous – does ID exist in all three tables, and you want all records from each table where ID = 3?

    The bottom line is you need to use a LEFT JOIN to join the tables together, but it’s hard to give an example without knowing how the tables relate.

    Making some assumptions:

    SELECT *
    FROM tbl1
    LEFT JOIN tbl2 ON tbl2.tbl1_id = tbl1.id
    LEFT JOIN tbl3 ON tbl3.tbl1_id = tbl1.id
    WHERE tbl1.id = 3;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not too familiar with combinatorics, but I need to calculate C(m,n) using PHP.
I'm not too familiar with SQL Server, but I'm working on a script that
I'm not too familiar with regex but I know what I need to find-
Hi I'm not really too familiar with SQL queries using EE but I think
I'm not too familiar with networking in JAVA but what i'm basically trying to
I'm not too familiar with Linux/Bash, so I can't really find the right terms
I am not too familiar with sql server 2005. I have a schema in
I'm not too familiar with pascal but I got a script going that currently
Not too familiar with dtsx packages - can they be created/run outisde Visual Studio?
I am not too familiar with javascript. Can someone please explain this construct to

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.