how to add an new record from part of an old one

From: juerg(dot)rietmann(at)pup(dot)ch
To: pgsql-sql(at)postgresql(dot)org
Subject: how to add an new record from part of an old one
Date: 2001-05-17 12:32:40
Message-ID: OF1B99BF3B.7C029D4A-ONC1256A4F.00448E75@pup.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi there

I need to half copy and insert new data in a new record. Please see the SQL
statement, that is not working, but i think is shows what I'd like to do.
The fields a_nr and a_kurzbez will get the values from a form and a_bez
needs to be copied from an existing auftrag.

Thanks for any help ... jr

insert into auftrag (a_nr, a_kurzbez) values (123456789, 'testtext')
(select a_bez from auftrag where a_nr='200113672732')

============================================
PFISTER + PARTNER, SYSTEM - ENGINEERING AG
Juerg Rietmann
Grundstrasse 22a
6343 Rotkreuz
Switzerland

phone: +4141 790 4040
fax: +4141 790 2545
mobile: +4179 211 0315
============================================

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message George Moga 2001-05-17 14:28:04 Re: how to add an new record from part of an old one
Previous Message Jonathan Bartlett 2001-05-17 02:48:03 Re: Setting session global variables