pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Eckermann <jeff_eckermann@yahoo.com>
To: Peter T. Brown <peter@memeticsystems.com>
To: pgsql-sql@postgresql.org
Subject: Re: contracting tables
Date: Fri, 30 Nov 2001 07:45:36 -0800 (PST)
Message-ID: <20011130154536.41315.qmail@web20809.mail.yahoo.com> (raw)
In-Reply-To: <00e001c17930$aa8af8b0$7d00000a@PETER>

Thinking about that some more:

SELECT INTO table2 DISTINCT * FROM table1;
TRUNCATE table1;
INSERT INTO table1 SELECT * FROM table2;
DROP TABLE2;

may be easiest, if you want to preserve table1, and
need distinct row values.

--- "Peter T. Brown" <peter@memeticsystems.com> wrote:
> Hi--
> 
> I have a table with many records, some of which are
> duplicates (there is no
> unique constraints). How can I contract this table
> to remove any of these
> duplicate records? Like when using GROUP BY in a
> select statement, except
> that I want to just remove the extra entries from
> this table directly... Any
> ideas?
> 
> 
> Thanks,
> 
> Peter Brown
> 
> 
> ---------------------------(end of
> broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please
> send an appropriate
> subscribe-nomail command to majordomo@postgresql.org
> so that your
> message can get through to the mailing list cleanly


__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1



view thread (9+ messages)  latest in thread

Message-ID: <20011130154536.41315.qmail@web20809.mail.yahoo.com>
Permalink:  ../20011130154536.41315.qmail@web20809.mail.yahoo.com/
Also on:    postgresql.org/message-id/20011130154536.41315.qmail@web20809.mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: jeff_eckermann@yahoo.com, peter@memeticsystems.com
  Subject: Re: contracting tables
  In-Reply-To: <20011130154536.41315.qmail@web20809.mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox