Re: Bulk coying of data from one table to another

From: Devrim GUNDUZ <devrim(at)gunduz(dot)org>
To: shoaib <shoaibm(at)vmoksha(dot)com>
Cc: "'Postgres general mailing list'" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Bulk coying of data from one table to another
Date: 2003-06-02 11:08:03
Message-ID: Pine.LNX.4.44.0306021404470.22058-100000@emo.org.tr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Hi,

On Mon, 2 Jun 2003, shoaib wrote:

> I want to run a process of archival which will delete data form one
> table and insert into another based on date critria.

If you've created the new table; then the following might be useful for
you:

INSERT INTO new_table SELECT * FROM old_table WHERE date_condition;

If you haven't creted the table; then use:

CREATE TABLE new_table AS SELECT * FROM old_table WHERE date_condition.

Regards,
--
Devrim GUNDUZ
devrim(at)gunduz(dot)org devrim(dot)gunduz(at)linux(dot)org(dot)tr
http://www.tdmsoft.com
http://www.gunduz.org

In response to

Browse pgsql-general by date

  From Date Subject
Next Message shreedhar 2003-06-02 11:10:48 Re: Bulk coying of data from one table to another
Previous Message Jean-Michel POURE 2003-06-02 10:50:38 Re: [GENERAL] PostgreSQL presentation in France