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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T06:58:52+00:00 2026-06-02T06:58:52+00:00

What i have is approximately 15 tables, each with about 10 columns and almost

  • 0

What i have is approximately 15 tables, each with about 10 columns and almost 1 million rows of data.

All the 15 tables have the same primary keys I can use to join them by.

For example..
Table 1 – Columns A B C D E
Table 2 – Columns A B F G H
Table 3 – Columns A B I J K
Table 4 – Columns A B L M N
etc.. where A & B are the primary keys

What I need would be one huge table that looks like this..
mainTable – Columns A B C D E F G … M N

Right now, what I have done is:
– Start off with Table 1 as my “main” table
– Alter the table to add all the columns.. (i.e. F G H .. L M N)
– use an UPDATE command to fill in the “main” table

update mainTable set 
 F = a.F,
 G = a.G,
 H = a.H
from mainTable left join Table2 a on
mainTable.A = a.A  and 
mainTable.B = a.B 

(rinse and repeat for each of the 15 tables)

This seems to work, just that it’s horribly inefficient. It takes ages to join just one table..

Is there an alternative/faster method of performing this task?

  • 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-02T06:58:53+00:00Added an answer on June 2, 2026 at 6:58 am

    Updates are often slower than inserts. Rather create a new table and insert all the data into it.

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

Sidebar

Related Questions

I have 16 1D arrays with approximately 10-11 million double-precision elements each. I need
I have a MySQL table with about 2 million rows, and a script that
I have an application that stores approximately 24 fields of data about a machine.
I have a table which has approximately sixty tables, and other tables are added
I have a SQL Server 2008 database with approximately 14 millions rows. In it
I have a table that contains approximately 22000 rows and I used a Boolean
I have a table with the columns, id, date, estValue & gradeid. Each grade
I have an sqlite database used to store information about backup jobs. Each run,
I have approximately 2500 tables involved in a calculation. In my dev environment I
I have large database table, approximately 5GB, now I wan to getCurrentSnapshot of Database

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.