title: Update table from self table where value in the column is not null
body: <p>I have a table containing values:</p>
  
  <pre><code>dbid    name         userid
  ------------------------------
  154     xyz          NULL
  987     xyz          NULL
  777     xyz          5
  111     abc          NULL
  745     abc          NULL
  748     abc          6
  </code></pre>
  
  <p>expected output:</p>
  
  <pre><code>dbid     name     userid
  ------------------------------
  154     xyz          5
  987     xyz          5
  777     xyz          5
  111     abc          6
  745     abc          6
  748     abc          6
  </code></pre>
  
  <p>There are all null values in the userid column except one for one name. I want to set 5 in userid for all rows where name = 'xyz'.
  Similarly, want to update the table to set 6 in userid where name = 'abc'.</p>
  
  <p>What should be the query to update a table for the above scenario?</p>
  
  <p>Note: Above is just an example. I have a table containing hundreds of thousands of records. I cannot write id 5 or 6 in the query.</p>