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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:52:08+00:00 2026-06-04T05:52:08+00:00

Background I know this question is a little weird, but here’s the explanation. I

  • 0

Background
I know this question is a little weird, but here’s the explanation.

I have TableA in my database. I then have two separate queries that contain joins from 2 other master tables:

SELECT TableA.*
FROM MasterTable_1 INNER JOIN TableA
ON MasterTable_1.ID = TableA.ID
WHERE MasterTabe_1.Field = 'some specific value';

and

SELECT TableA.*
FROM MasterTable_2 INNER JOIN TableA
ON MasterTable_2.ID = TableA.ID
WHERE MasterTabe_2.Field = 'some specific value';

I now have values from TableA in 2 queries, same columns and everything, but this is really like having 2 tables and I cannot figure out how to get one table and one set of columns from all the data.

Question
So, my question is how can I get the TableA values from the separate SELECT/JOIN queries into one table with one set of columns where I can call SELECT DISTINCT on that final table.

If this requires more explanation let me know. Hopefully I was able to explain it well enough.

  • 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-04T05:52:11+00:00Added an answer on June 4, 2026 at 5:52 am

    You would want to use a UNION:

    SELECT TableA.*
    FROM MasterTable_1 INNER JOIN TableA
    ON MasterTable_1.ID = TableA.ID
    WHERE MasterTable_1.Field = 'some specific value';
    UNION ALL
    SELECT TableA.*
    FROM MasterTable_2 INNER JOIN TableA
    ON MasterTable_2.ID = TableA.ID
    WHERE MasterTable_2.Field = 'some specific value';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this may be a dumb question, but my background is more in
I know this question may be a little bit common and over asked but
I know this may be obvious, but i didn't set the background to any
I know this might be obvious, but bear with me my generic programming background
First I will give a little background info so this question isn't completely without
I know this question has been asked many times, but my problem is a
I know I asked a similar question to this not long ago, but I'm
A little background here: I know what a data warehouse is , more or
I have very little background in website programming so I apologise if this might
Background: I have extensive experience in web applications, but I have very little or

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.