title: Mysql update values
body: <p>I'm using two tables in the database. The first table looks like this:</p>
  
  <pre><code>   id    |   msg_id   |     user   |   date   
  -------------------------------------------------
     01    |    122     |    user 1  | 2011-04-01
     02    |    453     |    user 2  | 2011-04-03
     03    |    124     |    user 3  | 2011-04-05
  </code></pre>
  
  <p>And the second table looks like this:</p>
  
  <pre><code>       id    |   msg_id   |     status   | 
     ----------------------------------------
         01    |      0     |       1      | 
         02    |      0     |       1      | 
         03    |     124    |       1      | 
  </code></pre>
  
  <p>I want to update all the rows with the "0" value ("msg_id" column) in the second table based on msg_id records  from the first table.
  Is it possible to do it with a single query?</p>
  
  <p>The result should look like:</p>
  
  <pre><code>       id    |   msg_id   |     status   | 
     ----------------------------------------
         01    |    122     |       1      | 
         02    |    453     |       1      | 
         03    |    124     |       1      | 
  </code></pre>