title: Update values in one column based on another column
body: <p>I would like to update <code>USER_FNM</code> in temporary table <code>@Users</code> with values from table <code>BAUSER</code>.</p>
  
  <p>Table <code>@Users</code>:</p>
  
  <pre><code>DECLARE @USERS TABLE
  (
    USER_KEY INT,
    USER_FNM VARCHAR(50),
    USER_LNM VARCHAR(50),
    USDE_HSU DECIMAL(8,2),
    [110000003] DECIMAL(8,2),
  [120000002] DECIMAL(8,2),
  [120000003] DECIMAL(8,2)
  )
  </code></pre>
  
  <p>What I've already tried is this:</p>
  
  <pre><code>update @USERS 
  set USER_FNM = (select top(1) user_fnm from bauser where bauser.user_key = USER_KEY)
  </code></pre>
  
  <p>But this always return the first value from <code>BAUSER</code> table. How to iterate over each row of <code>@Users</code> and change <code>USER_FNM</code>?</p>