title: SQL find duplicates of LIKE records
body: <p>I need to find duplicate of "like" records. This is what I mean by that.</p>
  
  <p>I have catalog numbers as characters, like 'abc123' or 'a1b2c3'
  production all the sudden started padding these to 10 places, so new ids go in as 0000abc123
  so they are off to the races putting data in and it's "technically" unique.</p>
  
  <p>What I need to do is hunt down all the records that have matches between the not-padded and the padded.</p>
  
  <p>I have tried this </p>
  
  <pre><code>SELECT p.sku, COUNT(p.id)
  FROM  products p
  GROUP BY p.sku
  HAVING COUNT(p.id) &gt; 1
  </code></pre>
  
  <p>Which gives me a count of duplicates (helpful, but not helpful enough)</p>
  
  <p>I think I need a UNION  but I am unclear how to proceed.
  ANY help is appreciated</p>
  
  <p>So to state it in English</p>
  
  <p>Find all records with a length of 10 and find any other records where the right most characters match the right most characters of the length of 10 records.</p>
  
  <p>so </p>
  
  <pre><code>00000asdfg would match 'asdfg' but would not match 'sdfg'
  </code></pre>
  
  <p>I guess I'm trying to match on any characters NOT '0' on the left</p>
  
  <p>DB2 v10</p>