transfer data

Поиск
Список
Период
Сортировка
От Detlef Jockheck
Тема transfer data
Дата
Msg-id 200304081717.h38HHOY02431@krakatau.jockheck.de
обсуждение исходный текст
Ответы Re: transfer data  (Dennis Gearon <gearond@cvc.net>)
Список 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 по дате отправления:

Предыдущее
От: Doug McNaught
Дата:
Сообщение: Re: How can I indicate the readline location ???
Следующее
От: Dennis Gearon
Дата:
Сообщение: Re: transfer data