Re: contracting tables

From: Jeff Eckermann <jeff_eckermann(at)yahoo(dot)com>
To: "Peter T(dot) Brown" <peter(at)memeticsystems(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: contracting tables
Date: 2001-11-30 15:45:36
Message-ID: 20011130154536.41315.qmail@web20809.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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(at)memeticsystems(dot)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(at)postgresql(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Randal L. Schwartz 2001-11-30 16:39:30 Re: contracting tables
Previous Message Jeff Eckermann 2001-11-30 15:38:54 Re: contracting tables