On Fri, 24 Sep 2010 18:12:18 +0100 Oliver d'Azevedo Christina <oliveiros.crist...@gmail.com> wrote:
>>> SELECT DISTINCT trainer_id,trainer_name >>> FROM ( >>> SELECT trainer_name -- The field you want to test for duplicates >>> FROM ( >>> SELECT DISTINCT "trainer_id","trainer_name" >>> FROM student >>> ) x >>> GROUP BY "trainer_name" -- the field you want to test for >>> duplicates >>> HAVING (COUNT(*) > 1) >>> ) z >>> NATURAL JOIN student y What indices would you recommend for this operation? -- Best Regards, Tarlika Elisabeth Schmitz -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql