I've got a large database of items and everyday If only to operate a script that moves rows with active = '1' right into a new table and removes the initial row.
However I can't appear to obtain the appropriate Mysql command to complete the migration.
It is always good if a person could shed some light around the situation.
You need to have the ability to complete this using the following
CREATE TABLE NewTable LIKE OldTable; INSERT INTO NewTable SELECT * FROM OldTable WHERE Active = 1; DELETE FROM OldTable WHERE Active = 1;
Just like curiosity, what's the reason for carrying this out? If you are concerned about the fuzzy rows you could do this the remove the following
DELETE OldTab FROM OlTable AS OldTab INNER JOIN NewTable AS NewTab ON OldTab.ID = NewTab.ID
with no particulars, here's what you is going to do:
create an Place statement towards the new table AS Choose in the old table WHERE active = 1.
produce a Remove statement that removes in the first table any rows it finds within the second table.