X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 2B417474E5C for ; Sun, 9 Feb 2003 20:48:36 -0500 (EST) Received: from filter.mimos.my (filter.mimos.my [192.228.137.70]) by postgresql.org (Postfix) with ESMTP id 8924C474E53 for ; Sun, 9 Feb 2003 20:48:33 -0500 (EST) Received: from ew.mimos.my (localhost.localdomain [127.0.0.1]) by filter.mimos.my (8.11.6/8.11.6) with ESMTP id h1A1auV20154 for ; Mon, 10 Feb 2003 09:36:57 +0800 Received: (from root@localhost) by ew.mimos.my (8.12.3/8.12.3) id h1A1mXbk066169 for pgsql-sql@postgresql.org; Mon, 10 Feb 2003 09:48:33 +0800 (MYT) (envelope-from wahab@mimos.my) Received: from mimos.my (sol-wel197.nat.mimos.my [10.1.23.197]) by ew.mimos.my (8.12.3/8.11.6) with ESMTP id h1A1mW1t066037 for ; Mon, 10 Feb 2003 09:48:32 +0800 (MYT) (envelope-from wahab@mimos.my) Message-ID: <3E4704EA.A7A813CC@mimos.my> Date: Mon, 10 Feb 2003 09:48:27 +0800 From: Abdul Wahab Dahalan Reply-To: wahab@mimos.my Organization: Mimos Berhad X-Mailer: Mozilla 4.77 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: How to delete duplicate record X-scanner: scanned by Inflex 1.0.10 - (http://pldaniels.com/inflex/) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/182 X-Sequence-Number: 11580 How do I delete a duplicated records? Here I've 7 duplicated records and tried to delete 6 from them. I tried this query but has error b2b=> delete from biztypes where bizid = (select bizid from biztypes where bizid = 'B116' limit 6); ERROR: More than one tuple returned by a subselect used as an expression. I tried this query, but all records are deleted. b2b=> delete from biztypes where bizid = (select bizid from biztypes where bizid = 'B116' limit 1); DELETE 7 Any help are very much appreciated.. Thanks. Wahab