title: How to select and update a record at the same time in mySQL?
body: <p>Is there any way to select a record and update it in a single query?</p>
  
  <p>I tried this:</p>
  
  <pre><code>UPDATE arrc_Voucher 
    SET ActivatedDT = now() 
  WHERE (SELECT VoucherNbr, VoucherID
           FROM arrc_Voucher
          WHERE ActivatedDT IS NULL
            AND BalanceInit IS NULL
            AND TypeFlag = 'V'
          LIMIT 1 )
  </code></pre>
  
  <p>which I hoped would run the select query and grab the first record that matches the where clause, the update the ActivatedDT field in that record, but I got the following error:</p>
  
  <blockquote>
    <p>1241 - Operand should contain 1 column(s)</p>
  </blockquote>
  
  <p>Any ideas?</p>