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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T16:57:22+00:00 2026-05-20T16:57:22+00:00

Table1: ID,Name,some more columns Table2: ID Table3: Name I want get output from table1,

  • 0
Table1: ID,Name,some more columns
Table2: ID
Table3: Name

I want get output from table1, whose IDs are present in Table2.IDs & whose Name are present in Table3.Name.

In other words, select data which is present in ALL the 3 tables.

For ex:

Table1:

1 John
2 Will
3 Michael

Table2:

1

Table3:

Will

The output should be

1 John
2 Will
  • 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-20T16:57:23+00:00Added an answer on May 20, 2026 at 4:57 pm

    You need to use JOINs.

    Your description and your sample output do not match, so I’ll give you one example for each.

    Based on your description, it should be 2 INNER JOINs:

    select table1.id, table1.name
    from table1
    inner join table2 on table2.id = table1.id
    inner join table3 on table3.name = table1.name
    

    Based on your output, it should be 2 OUTER JOINS with a WHERE clause specifying that at least one of the 2 joins was satisfied:

    select table1.id, table1.name
    from table1
    left outer join table2 on table2.id = table1.id
    left outer join table3 on table3.name = table1.name
    where table2.id is not null or table3.name is not null
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables with the following columns: table1: id, agent_name, ticket_id, category, date_logged
I have a query like this: SELECT TABLE_NAME, COLUMN_NAME, IS_NULLABLE, DATA_TYPE FROM MY_DB.INFORMATION_SCHEMA.COLUMNS WHERE
For example, mysql quote table name using SELECT * FROM `table_name`; notice the `
I want to get the results of a left join between two tables, with
I am working with some tables where I want the C# class to have
I have an oracle table with nested tables in some of the columns. Now,
i'm trying to migrate some data from two tables in an OLD database, to
I have the following code: ListBox.DataSource = DataSet.Tables(table_name).Select(some_criteria = match) ListBox.DisplayMember = name The
I have a script that takes a table name and generates a control file
When we execute select count(*) from table_name it returns the number of rows. What

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.