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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:07:56+00:00 2026-06-14T18:07:56+00:00

I have three tables that have the exact same columns, the only difference is

  • 0

I have three tables that have the exact same columns, the only difference is the data in those columns. I was wondering if (and how) I should merge the columns into one table. I know that the data would be distinguishable by a boolean value if you merge two tables, but can the same be done with three tables?

Any help would be appreciated.

  • 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-14T18:07:57+00:00Added an answer on June 14, 2026 at 6:07 pm

    If the columns and datatypes are the same, then you can use a UNION ALL query.

    select col1, col2, 'table1' as src
    from table1
    union all
    select col1, col2, 'table2' as src
    from table2
    union all
    select col1, col2, 'table3' as src
    from table3
    

    This version will include any duplicate records, if you don’t want duplicates then you can use UNION which will remove any duplicated records.

    If the datatypes are not the same, then you will need to convert the data to be of the same type.

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

Sidebar

Related Questions

I have three different tables that have the exact same style rules applied to
I have a MySQL query that: gets data from three tables linked by unique
I have a Microsoft SQL Server 2008 query that returns data from three tables
I have a table in my data base that has three columns: Screen, Icon,
Lets say that I have three tables, customers, orders and orderDetails. I'm doing this:
Need help with a query that I wrote: I have three tables Company id
I have a table that has three different date columns, so I set each
I have three columns in mysql table: tax_id, company_name, store_name. I need that tax_id
I have two tables which have the exact same structure. Both tables can store
Background In a PostgreSQL 9.0 database, there are various tables that have many-to-many relationships.

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.