Moving rows between tables in MySQL?
<p>I have two tables (<code>campaigns</code> and <code>old_campaigns</code>) in a MySQL database.</p>

<p>Both tables have identical columns:  <code>id, user_id, url, ordered, sent, start_date, end_date</code>.</p>

<p>The columns <code>ordered</code> and <code>sent</code> are both integers.  Here's what I want to do:</p>

<p>I want to check to see if the number in the <code>sent</code> column is 1.25x higher than the number in the <code>ordered</code> column.  If it is, I want to move that row from that row from the <code>campaigns</code> to <code>old_campaigns</code> table.</p>

<p>For example, if <code>ordered</code> was 100, then if <code>sent</code> was 125+, that row should be moved.</p>

<p>I'm technically already doing this with PHP, I'm really just looking to see if there's a way to do this with pure MySQL and move all the rows at the same time, since my PHP script is currently having to loop through each row and check.</p>