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

to another table ,table2

can anyone plz help me

Recommended Answers

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

[code]
INSERT INTO newtable (field1, field2) SELECT field1, field2 FROM oldtable WHERE flag = '1'
[/code]

Jump to Post

All 3 Replies

Please consider to mark this thread solved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.