tags:

views:

27

answers:

3

Having carefully and painfully manually populated/manipulated a series of records in a table, I want to retain them for reuse. As the table is rewritten daily I'd like to save JUST these particular records as a series of "inserts". The only way I know how to do this is to dump the whole table as sql using a GUI eg sqlyog.

But is there any quicker/better way to do this?

+1  A: 

would mysqldump help ? (it's not a GUI)

edit : note that you can save only part of a table using this tool. since it's command line, you can automate the task easily.

David V.
+1  A: 

Create a copy of your table with a meaningful name and copy using a INSERT the records your interested in.

Doing it this way gives the most flexibility should you need to copy them back/compare them.

CResults
A: 

Providing you still have your clean manually populated table available. Copy it into another table:

CREATE TABLE mytable_backup SELECT * FROM mytable;

Then you can re-introduce these to your daily rebuild table using a similar method:

INSERT INTO mytable SELECT * FROM mytable_backup;

Does this help?

Greg K
Greg, looks good I guess you can add a where to CREATE TABLE mytable_backup SELECT * FROM mytable where blah-blah;
zzapper