title: Fetching multiple rows based on grouping
body: <p>Consider this data</p>
  
  <pre>
  PK field1 field2
  1  a      b
  2  a      (null)
  3  x      y
  4  x      z
  5  q      w
  </pre>
  
  <p>I need to get this data</p>
  
  <p>select all columns from all rows where field1 has count >1</p>
  
  <p>Which means the desired output is</p>
  
  <pre>
  PK field1 field2
  1  a      b
  2  a      (null)
  3  x      y
  4  x      z
  </pre>
  
  <p>i tried and finally settled for </p>
  
  <pre><code>select * from mytable  where field1 in 
  (select field1 from mytable group by field1 having count(field1)&gt;1 ) order by field1
  </code></pre>
  
  <p>but there has to be a better way than this</p>