Re: Copying rows between tables?

From: Sai Hertz And Control Systems <sank89(at)sancharnet(dot)in>
To: swampler(at)noao(dot)edu
Cc: Postgres-SQL <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Copying rows between tables?
Date: 2004-01-13 18:49:56
Message-ID: 40043DD4.4090802@sancharnet.in
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Dear Steve Wampler

>I have an application where old records are archived into
>'archive' tables. Occasionally there is a need to copy
>some of these old records into the 'active' table.
>
>
source_table(id: bigserial,uname: char,x1: char,x2: char,x3: char,x4: char)
dest_table(id: bigserial,uname: char,x11: char,x21: char,x31: char,x41:
char)

you will do some thing like
insert into dest_table(id,uname,x11,x21) (select id,uname,x1,x2 from
source_table)

Shootback if this helps

Regards,
Vishal Kashyap

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message OizOne 2004-01-13 19:34:08 help with limiting query results
Previous Message beyaRecords - The home Urban music 2004-01-13 18:45:55 Configure issues