title: Mysql update a row with another row value in same table
body: <p>I have a table.  I want to update the 5th row with 10th row values from the same table.  For example:</p>
  
  <pre><code>SlNo   Name Quali   Exp
  1        x   B.E     2
  2        y   BSC     3
  3        Z   B.A     1.5
  4        A   MSC     2
  5        B   MBA     5
  </code></pre>
  
  <p>Here i want to update second row with the value of 5th row.</p>
  
  <p>Here is my current query:</p>
  
  <pre><code>    UPDATE table 
        SET Name=(select Name from table where slNo='5'),
                 Quali=(select Quali from  table where slNo='5'),
                 Exp=(select Exp from table where slNo='5') 
        where slNo='3';
  </code></pre>
  
  <p>this is working fine ... but if there are more than 20 columns it becomes laborious to write a query this way, because for each column I have to include another sub-query... is there any other way to write query to update the whole row with all values from the other row in the same table?</p>