title: Update multiple rows based on other table column values
body: <p>Here is the query I have so far and I understand WHY it isn't working... Just having a hard time forming a solution.</p>
  
  <pre><code>UPDATE wrkque
  SET locacc = (SELECT locmst.locacc
              FROM locmst,
                   wrkque
             WHERE locmst.stoloc = wrkque.srcloc
               AND wrkque.oprcod = 'TRN')
  WHERE wrkque.oprcod = 'TRN'
  AND wrkque.srcloc IN (SELECT locmst.stoloc
                          FROM locmst,
                               wrkque
                         WHERE locmst.stoloc = wrkque.srcloc)
  </code></pre>
  
  <p>The inner query returns multiple rows. I believe I need to do a partition by type query but a tad unsure.</p>
  
  <p>Essentially, I need to update the wrkque table so that all row instances that are of "TRN" (Transfers) are updated to reflect the "locacc" (Location Access) from the locmst table.</p>
  
  <p>The key to linking both tables rows to eachother is locmst.stoloc and wrkque.srcloc.</p>
  
  <p>Any help is GREATLY appreciated.</p>