X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3D5EE528A5 for ; Tue, 24 May 2005 17:59:39 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 21055-05 for ; Tue, 24 May 2005 20:59:37 +0000 (GMT) Received: from iracema.dnscenter.com.br (iracema.dnscenter.com.br [67.15.81.98]) by svr1.postgresql.org (Postfix) with ESMTP id 78F5052894 for ; Tue, 24 May 2005 17:59:36 -0300 (ADT) Received: from cpanel by iracema.dnscenter.com.br with local (Exim 4.51) id 1DagUt-0000Y2-D9 for pgsql-sql@postgresql.org; Tue, 24 May 2005 17:59:31 -0300 Received: from 200.158.187.17 ([200.158.187.17]) by www.presserv.org (Horde) with HTTP for ; Tue, 24 May 2005 17:59:31 -0300 Message-ID: <20050524175931.4dp41vy7v10c4wc4@www.presserv.org> Date: Tue, 24 May 2005 17:59:31 -0300 From: lucas@presserv.org To: pgsql-sql@postgresql.org Subject: Duplicated records MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.0) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - iracema.dnscenter.com.br X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [32001 502] / [47 12] X-AntiAbuse: Sender Address Domain - presserv.org X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.639 tagged_above=0 required=5 tests=AWL, NO_REAL_NAME X-Spam-Level: X-Archive-Number: 200505/209 X-Sequence-Number: 21522 Hi. How can I delete the duplicated records with "DELETE FROM TABLE WHERE..." clause?? The problem is becouse I have imported data from Dbase (dbf) file, and this function have not built the Constraint (unique, primary key, ...), and this function is usually executed. select * from table1; --id may be primary key - Table1 - id | field 2 0 | 'aaa' 1 | 'bbb' 2 | 'ccc' 0 | 'aaa' <<== The data is duplicated 1 | 'bbb' 2 | 'ccc' 0 | 'aaa' 1 | 'bbb' 2 | 'ccc' Is there a way to delete the duplicated data without build another table with constraints and copy those data to the new table? Something like "delete from table1 where ...???" Thanks, Lucas