Codechef4u is a community for computer professionals,by computer professionals,just like you; who loves sharing and helping each others,Join them
Share your post

Answers


Use "insert into select" statement for same

Syntax

INSERT INTO table2
SELECT * FROM table1
WHERE condistion;


Example

Schema is same in both tables

 

INSERT INTO newTable
SELECT * FROM oldTable

 

Schema is different in tables

 

INSERT INTO newTable (col1, col2, col_n)
SELECT column1, column2, col_n
FROM oldTable

Share your answer


Share as a guest

Please subscribe me to the CodeChef4U.

By creating your new answer, you agree to the privacy policy and terms of service.