Update a table from another table

Поиск
Список
Период
Сортировка
От Jason Tan Boon Teck
Тема Update a table from another table
Дата
Msg-id AANLkTik5yLqzacXgwtki5z3fTeacMZ2cROkkzAe3yEpi@mail.gmail.com
обсуждение исходный текст
Ответы Re: Update a table from another table  (Andreas <maps.on@gmx.net>)
Список pgsql-novice
Hi,


I am trying to update tableA with records from tableB, in a single SQL
statement, along the lines of

INSERT INTO tablea SELECT * FROM tableb;

but doing UPDATE instead. The manual says

UPDATE [ ONLY ] table [ [ AS ] alias ]
    SET { column = { expression | DEFAULT } |
          ( column [, ...] ) = ( { expression | DEFAULT } [, ...] ) } [, ...]
    [ FROM from_list ]
    [ WHERE condition | WHERE CURRENT OF cursor_name ]
    [ RETURNING * | output_expression [ [ AS ] output_name ] [, ...] ]

I am having trouble defining the SET part of the statement. The table
has many columns. Is there a wild card or something.

Thanks in advance.


--
Jason Tan Boon Teck

В списке pgsql-novice по дате отправления:

Предыдущее
От: Joshua Tolley
Дата:
Сообщение: Re: PgFouine
Следующее
От: Andreas
Дата:
Сообщение: Re: Update a table from another table