January 10, 2012 at 6:54 am
HI All,
I want to insert multiple tables data into single table.
EX: i have 3 tables ::table1 , table2 , table3 , new table is table4
table1 has 4 columns a1,a2,a3,a4
table2 has 5 columns b1,b2,b3,b4,b5
table3 has 3 columns c1,c2,c3
Now i want to insert table1 --a1,a2 ,table2 b4,b5,
table3 c1 data into table4 .
January 10, 2012 at 6:57 am
one more clarification table1,2,3 in different database .
table4 in another database .
January 10, 2012 at 7:02 am
A JOIN query should work. First of all create a query to SELECT data from 3 different tables with fully qualified names. Then add INSERT statement to insert these rows into new table.
January 10, 2012 at 7:10 am
What is the relationship between the data in table1, table2 and table3? You can't just put some columns from one table and some from another in the same row of a new table without there being some kind of link - that would be a bit like adding oranges to elephants. Maybe if you could provide full table DDL (including foreign key constraints) and a bit of sample data we'll be able to help better.
John
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply