954,560 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Copy selected fileds from one table to other

Hi ,
I want to copy the selected fields,
eg:SELECT * FROM table1 where flag='1';

to another table ,table2

can anyone plz help me

rahulroshan
Light Poster
27 posts since Aug 2011
Reputation Points: 10
Solved Threads: 0
 

http://dev.mysql.com/doc/refman/5.5/en/insert-select.html

INSERT INTO newtable (field1, field2) SELECT field1, field2 FROM oldtable WHERE flag = '1'
pritaeas
Posting Expert
Moderator
5,480 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
 

thanks a lot :)

rahulroshan
Light Poster
27 posts since Aug 2011
Reputation Points: 10
Solved Threads: 0
 

Please consider to mark this thread solved.

pritaeas
Posting Expert
Moderator
5,480 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: