Skip site navigation (1) Skip section navigation (2)

Problem with select statement for duplicate data

From: Machiel Richards <machielr(at)rdc(dot)co(dot)za>
To: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Problem with select statement for duplicate data
Date: 2010-12-21 09:35:36
Message-ID: 1292924136.8774.4.camel@machielr-laptop (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
Hi All

        I am trying to runt he following select statement on a table in
order search for duplicate rows in the table

                select column1,column2,column3,count() from table group
by column1,column2,column3 having count() > 1;

        This however gives me the following error:

                ERROR: count(*) must be used to call a parameterless
aggregate function

        Does anybody know what the correct statement or syntax is in
postgres in order to run the same type of query?

            I need to go through 974 tables to look for duplicate rows
in all the tables, however struggling to get this command right.



pgsql-novice by date

Next:From: Jayadevan MDate: 2010-12-21 09:57:00
Subject: Re: Problem with select statement for duplicate data
Previous:From: Николай ИжиковDate: 2010-12-21 09:11:15
Subject: linux ossp-uuid

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group