title: Postgres: select all row with count of a field greater than 1
body: <p>i have table storing product price information, the table looks similar to, (no is the primary key)</p>
  
  <pre><code>no   name    price    date
  1    paper   1.99     3-23
  2    paper   2.99     5-25
  3    paper   1.99     5-29
  4    orange  4.56     4-23
  5    apple   3.43     3-11
  </code></pre>
  
  <p>right now I want to select all the rows where the "name" field appeared more than once in the table. Basically, i want my query to return the first three rows.</p>
  
  <p>I tried:</p>
  
  <pre><code>SELECT * FROM product_price_info GROUP BY name HAVING COUNT(*) &gt; 1  
  </code></pre>
  
  <p>but i get an error saying:</p>
  
  <blockquote>
    <p>column "product_price_info.no" must appear in the GROUP BY clause or be used in an aggregate function</p>
  </blockquote>