title: How to mark duplicates in an SQL query
body: <p>I have an SQL query which looks at date-of-birth, last name and a soundex of first name to identify duplicates.  The following query finds some 8,000 rows (which I assume means there are around 8,000 duplicate records).</p>
  
  <pre><code>select dob,last_name,soundex(first_name),count(*)
  from clients
  group by dob,last_name,soundex(first_name)
  having count(*) &gt;1
  </code></pre>
  
  <p>Almost all of the results have a count of 2, a few have a count of 3 where obviously the record existed twice in one of the two databases which were merged.</p>
  
  <p>The next step I need to take is to mark one of the rows, doesn't really matter, with a duplicate flag and to mark each row with the opposite rows key.  Is there a way of doing this using SQL?</p>