title: Copy value from one row to another which share another same value
body: <p>I have a table similar to</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: left;">ID</th>
  <th style="text-align: center;">contract</th>
  <th style="text-align: right;">role</th>
  <th style="text-align: right;">beginn</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: left;">A</td>
  <td style="text-align: center;">1</td>
  <td style="text-align: right;">27</td>
  <td style="text-align: right;">2020-01-01</td>
  </tr>
  <tr>
  <td style="text-align: left;">B</td>
  <td style="text-align: center;">1</td>
  <td style="text-align: right;">14</td>
  <td style="text-align: right;">2021-01-01</td>
  </tr>
  <tr>
  <td style="text-align: left;">C</td>
  <td style="text-align: center;">2</td>
  <td style="text-align: right;">27</td>
  <td style="text-align: right;">2020-05-01</td>
  </tr>
  <tr>
  <td style="text-align: left;">D</td>
  <td style="text-align: center;">2</td>
  <td style="text-align: right;">14</td>
  <td style="text-align: right;">2021-01-01</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I would like to copy the beginn value of the 27 roles to the beginn of the 14 roles. This needs to be done grouped by the contract number.</p>
  <p>Eg.
  Beginn of row Id <strong>A</strong> should be <strong>copied to</strong> beginn of row id <strong>B</strong> and Beginn of row Id <strong>C</strong> should be <strong>copied to</strong> beginn of row id <strong>D</strong></p>
  <p>Desired outcome:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: left;">ID</th>
  <th style="text-align: center;">contract</th>
  <th style="text-align: right;">role</th>
  <th style="text-align: right;">beginn</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: left;">A</td>
  <td style="text-align: center;">1</td>
  <td style="text-align: right;">27</td>
  <td style="text-align: right;">2020-01-01</td>
  </tr>
  <tr>
  <td style="text-align: left;">B</td>
  <td style="text-align: center;">1</td>
  <td style="text-align: right;">14</td>
  <td style="text-align: right;"><strong>2020-01-01</strong></td>
  </tr>
  <tr>
  <td style="text-align: left;">C</td>
  <td style="text-align: center;">2</td>
  <td style="text-align: right;">27</td>
  <td style="text-align: right;">2020-05-01</td>
  </tr>
  <tr>
  <td style="text-align: left;">D</td>
  <td style="text-align: center;">2</td>
  <td style="text-align: right;">14</td>
  <td style="text-align: right;"><strong>2020-05-01</strong></td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Something like, but grouped by contract:</p>
  <pre><code>UPDATE MyTable
  SET
      beginn = otherRoleData.beginn
  FROM
      (
          SELECT
              beginn
          FROM
              mytable
          WHERE
              role = 27
      ) otherRoleData
  WHERE
      role =14;
  </code></pre>
  <p>How would I do this? I struggle with the group by condition...</p>