| От | Thomas G. Lockhart |
|---|---|
| Тема | Re: [HACKERS] update and select |
| Дата | |
| Msg-id | 36400164.4ADB4648@alumni.caltech.edu обсуждение исходный текст |
| Ответ на | update and select (Michael Meskes <meskes@usa.net>) |
| Ответы |
Re: [HACKERS] update and select
|
| Список | pgsql-hackers |
> In Oracle I'd be able to write:
> update test set c = (select c from test where i = 1) where i = 0;
> Is it correct that we do not allow this?
That is correct, and it is on the ToDo list as something like "allow
subselects in target expressions" (though I'm not finding it when I
look).
However, as you suspect you can rephrase it:
tgl=> update x set c = j.c from x as j where j.i = 1 and x.i = 0;
UPDATE 1
tgl=> select * from x;
i|c
-+-
1|T
2|A
0|T
(3 rows)
- Tom
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера