title: Set value of select statement into variable and use in update query mysql
body: <p>What I'm trying to achieve is to update a column on the database based on the result of a select query in mysql.</p>
  
  <p>For example:</p>
  
  <pre><code>SELECT id, value, t_stamp FROM table_name ORDER BY id DESC Limit 1
  </code></pre>
  
  <p>then the value of the SELECT statement say would be</p>
  
  <pre><code>id    value    t_stamp
  
  1      apple    2013-01-01
  
  2      dog      2013-01-01
  </code></pre>
  
  <p>so then the value of the SELECT would be from 2 right. but i want to get the value of the 'value' column and use that as a parameter for the UPDATE</p>
  
  <pre><code>UPDATE table_name SET newvalue = value_from_select
  </code></pre>
  
  <p>so then value of the newvalue would be dog. </p>
  
  <p>How can I do this in Mysql?</p>