title: Find duplicate Records in MySQL using LIKE
body: <p>I would like to find all duplicate records by name in a customer table using MySQL including those that do not match exactly.</p>
  
  <p>I know I can use the query</p>
  
  <pre><code>SELECT id, name FROM customer GROUP BY name HAVING count(*) &gt; 1;
  </code></pre>
  
  <p>to find all rows that match exactly, but I want to find all duplicate rows matching with a <code>LIKE</code> clause.  For instance there might be a customer with the name "Mark's Widgets" and another "Mark's Widgets Inc."  I would like my query to find these as duplicates.  So something along the lines of</p>
  
  <pre><code>SELECT id, name AS name1 ... WHERE name1 LIKE CONCAT("%", name2, "%") ...
  </code></pre>
  
  <p>I know that's completely incorrect but that's the idea.  Here is the able schema:</p>
  
  <pre><code>mysql&gt; describe customer;
  +-----------------------------+--------------+------+-----+------------+----------------+
  | Field                       | Type         | Null | Key | Default    | Extra          |
  +-----------------------------+--------------+------+-----+------------+----------------+
  | id                          | int(11)      | NO   | PRI | NULL       | auto_increment |
  | name                        | varchar(140) | NO   |     | NULL       |                |
   ...
  </code></pre>
  
  <p><strong>EDIT:</strong> To clarify, I want to find all duplicates, not just duplicates of one specific customer name.</p>