title: Update SQL column if have duplicate values
body: <p>I'm trying to write a query  to update my table if any value appear more than one time. Example:</p>
  <p>table:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: left;">name</th>
  <th style="text-align: center;">value</th>
  <th style="text-align: right;">code</th>
  <th style="text-align: right;">duplicated</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: left;">Jho</td>
  <td style="text-align: center;">10</td>
  <td style="text-align: right;">81818</td>
  <td style="text-align: right;">false</td>
  </tr>
  <tr>
  <td style="text-align: left;">Buo</td>
  <td style="text-align: center;">90</td>
  <td style="text-align: right;">81808</td>
  <td style="text-align: right;">false</td>
  </tr>
  <tr>
  <td style="text-align: left;">Jho</td>
  <td style="text-align: center;">10</td>
  <td style="text-align: right;">81818</td>
  <td style="text-align: right;">false</td>
  </tr>
  <tr>
  <td style="text-align: left;">May</td>
  <td style="text-align: center;">30</td>
  <td style="text-align: right;">81898</td>
  <td style="text-align: right;">false</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Jho appear more than one time, so I want to set each of column as duplicated= true</p>
  <p>table:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: left;">name</th>
  <th style="text-align: center;">value</th>
  <th style="text-align: right;">code</th>
  <th style="text-align: right;">duplicated</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: left;">Jho</td>
  <td style="text-align: center;">10</td>
  <td style="text-align: right;">81818</td>
  <td style="text-align: right;">true</td>
  </tr>
  <tr>
  <td style="text-align: left;">Buo</td>
  <td style="text-align: center;">90</td>
  <td style="text-align: right;">81808</td>
  <td style="text-align: right;">false</td>
  </tr>
  <tr>
  <td style="text-align: left;">Jho</td>
  <td style="text-align: center;">10</td>
  <td style="text-align: right;">81818</td>
  <td style="text-align: right;">true</td>
  </tr>
  <tr>
  <td style="text-align: left;">May</td>
  <td style="text-align: center;">30</td>
  <td style="text-align: right;">81898</td>
  <td style="text-align: right;">false</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I tried subquery, but it don't work:</p>
  <pre><code>UPDATE table SET duplicated = true
  FROM (SELECT name, COUNT(*) FROM table
        GROUP BY table.name HAVING COUNT(*) &gt; 1) as subquery
  WHERE subquery.count &gt; 1;
  </code></pre>
  <p>Any help on that?</p>