Re: Use select and update together

Поиск
Список
Период
Сортировка
От pasman pasmański
Тема Re: Use select and update together
Дата
Msg-id CAOWY8=bpkoexYaoqGJf42Fo4Zprj6TwmV6OukKvQkJSEg=Gqxw@mail.gmail.com
обсуждение исходный текст
Ответ на Use select and update together  (Boris <kuzikoff@ukr.net>)
Ответы Re: Use select and update together  (Andreas <maps.on@gmx.net>)
Список pgsql-sql
In 8.4 this syntax is not implemented.

2011/9/12, Boris <kuzikoff@ukr.net>:
> 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
>
> --
> Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql
>


-- 
------------
pasman


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

Предыдущее
От: Boris
Дата:
Сообщение: Use select and update together
Следующее
От: Samuel Gendler
Дата:
Сообщение: Re: Use select and update together