Tag Archives: copy

hmmm.. dint get much info about copying a row in mysql, so thought will put the code here.. its useful sometime..

the code is

INSERT INTO destinationTable (column_list) (SELECT column_list FROM sourceTable WHERE condition=check)

replace the condition with your condition.

To copy within the same table, the destination and the source table will be the same. And if you have an auto_increment counter in your table then do not include that column in the list!

chalo happy querying!

ps: that one should have come long back!