Skip to content
Advertisement

Postgres: select all row with count of a field greater than 1

i have table storing product price information, the table looks similar to, (no is the primary key)

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.

I tried:

but i get an error saying:

column “product_price_info.no” must appear in the GROUP BY clause or be used in an aggregate function

Advertisement

Answer

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement