Re: counting groups - Mailing list pgsql-general

From Holger Klawitter
Subject Re: counting groups
Date
Msg-id 39F57210.A62A7D6E@klawitter.de
Whole thread Raw
In response to counting groups  (Holger Klawitter <holger@klawitter.de>)
List pgsql-general
Hi I found the solution myself,

but perhaps someone is interested as well.

SELECT count(*)
FROM table
WHERE attr IN (
    SELECT attr
    FROM table
    WHERE condition
    GROUP BY attr
    HAVING count(*)>1
);

--
Regards,
Mit freundlichem Gruß,
    Holger Klawitter
--
Holger Klawitter                                    +49 (0)251 484 0637
holger@klawitter.de                            http://www.klawitter.de/


pgsql-general by date:

Previous
From: Holger Klawitter
Date:
Subject: counting groups
Next
From: Peter Keller
Date:
Subject: Problems with genetic optimizer