Use select and update together

Поиск
Список
Период
Сортировка
От Boris
Тема Use select and update together
Дата
Msg-id CAH4qf7Z=q0XVF-2bPL0Ag3mQREUqCLHgJEGcdPP66XMTd6n_7A@mail.gmail.com
обсуждение исходный текст
Ответы Re: Use select and update together  (pasman pasmański <pasman.p@gmail.com>)
Re: Use select and update together  (Samuel Gendler <sgendler@ideasculptor.com>)
Список pgsql-sql
Hi, this is my first on this list.

I can't understand where my problem in PG 8.4.

CREATE TABLE tbl( KEY  int, val int);

Update query like:

UPDATE tbl SET val = 1            WHERE KEY = any('{0,1,2,3,4,5}'::int[])        returning key;

work well. But any try to wrap it in select query like:

SELECT (        UPDATE tbl SET val = 1            WHERE KEY = any('{0,1,2,3,4,5}'::int[])        returning key
);

cause syntax error. Is any query of such type (update warped into
select) is possible?


Best regards, Kuzikov Borys


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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: FW: Hi
Следующее
От: pasman pasmański
Дата:
Сообщение: Re: Use select and update together