title: Remove Duplicate record from Mysql Table using Group By
body: <p>I have a table structure and data below. 
  <a href="https://i.stack.imgur.com/Hr2sZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Hr2sZ.png" alt="enter image description here"></a></p>
  
  <p>I need to remove duplicate record from the table list. My confusion is that when I am firing query </p>
  
  <pre><code>SELECT * FROM `table` GROUP BY CONCAT(`name`,department)
  </code></pre>
  
  <p>then giving me correct list(12 records).</p>
  
  <p><a href="https://i.stack.imgur.com/eOwlG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eOwlG.png" alt="enter image description here"></a></p>
  
  <p>Same query when I am using the subquery:</p>
  
  <pre><code>SELECT * 
  FROM `table` WHERE id IN (SELECT id FROM `table` GROUP BY CONCAT(`name`,department))  
  </code></pre>
  
  <p>It returning all record which is wrong. </p>
  
  <p><a href="https://i.stack.imgur.com/QQqwa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QQqwa.png" alt="Table Structure"></a></p>
  
  <p>So, My question is why <code>group by</code> in subquery is not woking.</p>