MySQLi: Best practice to select everything where [column] = # and process

advertisements

I am looking for the best practice for processing this query. I just want to make sure I am doing it right.

Query: Need to select all from database table where [column] = # and copy results to another table.


DELETE FROM table WHERE [column] = #

INSERT INTO table2 (col1, col2, col3)
(SELECT col1, col2, col3 FROM table WHERE  [column] = #)