Обсуждение: APPEND INTO?

Поиск
Список
Период
Сортировка

APPEND INTO?

От
Mark Fenbers
Дата:
I want to SELECT INTO mytable WHERE (criteria are met), except that I 
want to APPEND into an existing table the rows that are selected, 
instead of creating a new table (which SELECT INTO will do).  How can 
this be done?

(Is this what the "FOR UPDATE OF tablename" clause is for?)

Mark


Re: APPEND INTO?

От
Jaime Casanova
Дата:
On 12/1/05, Mark Fenbers <Mark.Fenbers@noaa.gov> wrote:
> I want to SELECT INTO mytable WHERE (criteria are met), except that I
> want to APPEND into an existing table the rows that are selected,
> instead of creating a new table (which SELECT INTO will do).  How can
> this be done?
>
> (Is this what the "FOR UPDATE OF tablename" clause is for?)
>
> Mark
>

INSERT INTO table SELECT ....

--
regards,
Jaime Casanova
(DBA: DataBase Aniquilator ;)


Re: APPEND INTO?

От
Tom Lane
Дата:
Mark Fenbers <Mark.Fenbers@noaa.gov> writes:
> I want to SELECT INTO mytable WHERE (criteria are met), except that I 
> want to APPEND into an existing table the rows that are selected, 
> instead of creating a new table (which SELECT INTO will do).  How can 
> this be done?

INSERT INTO foo SELECT whatever
        regards, tom lane