transfer data - Mailing list pgsql-general

From Detlef Jockheck
Subject transfer data
Date
Msg-id 200304081717.h38HHOY02431@krakatau.jockheck.de
Whole thread Raw
Responses Re: transfer data  (Dennis Gearon <gearond@cvc.net>)
List pgsql-general
Hi!

I have two tables:

Table A:
article_number, count
a    2
b    5
g    3

Table B:
article_number, count
b    7

Now I want to transfer 2 units of b and  3 units of g from Table A to table
B. So the result should be:

Table A:
article_number, count
a    2
b    3
g    0    (or empty line)

Table B:
article_number, count
b    9
g     3

What is the best way to do this transaction with postgresql? I've tried to do
this with update and insert statements from psql but I'm sure there is a
better way!?

ciao
Detlef

--
# Dipl. Ing. (FH) Detlef Jockheck
# E-mail: detlef@jockheck.de
# -------------------------------


pgsql-general by date:

Previous
From: Doug McNaught
Date:
Subject: Re: How can I indicate the readline location ???
Next
From: Dennis Gearon
Date:
Subject: Re: transfer data