Hi,
I need some help,
Can anyone tell how to copy records from one table to another table by using SQL Query.
Hi,
I need some help,
Can anyone tell how to copy records from one table to another table by using SQL Query.
If you want to create a single, new table with all the records (rather than overwriting one of the existing tables):
SELECT * FROM Table1OfPC1 ;
UNION ;
SELECT * FROM Table1OfPC2 ;
UNION ;
SELECT * FROM Table1OfPC3 ;
INTO TABLE NewTable1
You can use the following query.
Code:insert into newtablename select * from oldtablename
But if you want to Copy only Unique Records from one Table to Another Table
then use this query.
Code:insert into newtablename select distinct * from oldtablename
Hi,
Very nice piece of code.
Short and simple to understand.
Thanks for sharing your knowledge with us.
Keep posting.
Bookmarks