-
Inserting data into one table from multiple tables
I’ve a requirement as follows.
The data from 14 tables needs to be dumped into one table
While inserting the data, the columns’ values are to be calculated based on calculations
The calculations involve different columns from different tables.
The number of rows in the each of the 14 tables could be around 50000
Please suggest the best way to do this data transfer from 14 tables to one table.
Thanks in advance.
-
Re: Inserting data into one table from multiple tables
Originally posted by sln81
I’ve a requirement as follows.
The data from 14 tables needs to be dumped into one table
While inserting the data, the columns’ values are to be calculated based on calculations
The calculations involve different columns from different tables.
The number of rows in the each of the 14 tables could be around 50000
Please suggest the best way to do this data transfer from 14 tables to one table.
Thanks in advance.
Like this?
Code:
CREATE TABLE blah AS
SELECT *
FROM 14_tables
WHERE ...;
-
What about the performance of joining 14 tables?
-
Originally posted by sln81
What about the performance of joining 14 tables?
You can create the SELECT portion of the INSERT statement and then do an explain plan. You can grab the primary key and foriegn keys from the minimum tables to do the INSERT and then do updates from the remaining tables.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|