title: SQL Statement to select duplicate records appearing more than 2 times
body: <p>I need help to get the solution for this condition. I have a table containing records, there is a field sku, in this record i have sku's appearing multiple times.
  Table structure is like this 
  rid|id|sku|name</p>
  
  <p>rid is auto_increment, where is id is varchar, if any sku is available on table multiple times the record looks like this</p>
  
  <pre><code>rid  id  sku     name
  ---  --  ------  --------------
  1    3   rs-123  test product
  2    3   rs-123  test product
  3    4   rs-125  test product 2
  4    4   rs-125  test product 2
  5    4   rs-125  test product 2
  6    6   rs-126  test product 3
  </code></pre>
  
  <p>I used this sql statement to get records that appears only once</p>
  
  <pre><code>SELECT *
  FROM test
  GROUP BY id
  HAVING ( COUNT(id) = 1 )
  </code></pre>
  
  <p>This brings the records that are only added once, so according to above give record only rid 6 is the output</p>
  
  <p>I tried to modify the above code to this to get the result of the records which are added 2 times</p>
  
  <pre><code>    SELECT * FROM test 
  GROUP BY id 
  HAVING ( COUNT(id) = 2 )
  </code></pre>
  
  <p>The result I am getting is of those record which are added 2 times, but the issue is the output is appearing only 1 record like this;</p>
  
  <pre><code>rid  id  sku     name
  ---  --  ------  ------------
  1    3   rs-123  test product
  </code></pre>
  
  <p>I need to fetch all rows of record that are added 2 times in the database. Please help</p>