title: How to copy data from one row into another, in the same table?
body: <p>I am attempting to copy data from specific columns in one row, and have it inserted/updated into another row, all in the same table.  Each row already has an ID # (called order_no), so no auto-increment is needed. </p>
  
  <p>I thought this would be pretty simple, but it's just not working. my Table name is 'orders' and the columns are called 'rn' and 'phone' and the order_no are '416' and '417'. I want rn, and phone from 416 to be inserted into the rn, and phone columns for 417. </p>
  
  <p>I also have tried this query, attempting to copy just one record rn, with no success
  and get <strong>error: #1248 - Every derived table must have its own alias</strong></p>
  
  <pre><code>mysql_query("UPDATE orders
    SET rn =
       ( SELECT rn
          FROM ( SELECT rn
                  FROM orders
                    WHERE order_no = 416
               ) 
   WHERE order_no = 417 ");
  </code></pre>
  
  <p>I have tried this with no success, and get <strong>Error #1136 - Column count doesn't match value count at row 1</strong></p>
  
  <pre><code>  mysql_query
  (" INSERT INTO orders (rn, phone)
  SELECT rn, phone, 416
  from orders
  WHERE order_no = 417 ");
  </code></pre>
  
  <p><strong>Update.</strong> I also tried this query below, with just one field (rn) to no avail, and it throws error #1093 - You can't specify target table 'orders' for update in FROM clause:</p>
  
  <pre><code>     mysql_query("UPDATE orders 
  SET rn = (SELECT rn FROM orders WHERE order_no = '416') 
  WHERE order_no = '417' ");
  </code></pre>
  
  <p>Any help or assistance is greatly appreciated. Thank you</p>