| От | Bruno Wolff III |
|---|---|
| Тема | Re: how to update with a join? |
| Дата | |
| Msg-id | 20050910180352.GC11142@wolff.to обсуждение исходный текст |
| Ответ на | Re: how to update with a join? (MichaelHoeller@t-online.de) |
| Список | pgsql-sql |
On Sat, Sep 10, 2005 at 18:56:10 +0200, MichaelHoeller@t-online.de wrote: > Hello all, > > thanks for the answere to the prev. thread. With the help of them > I solved the problme I used "not like" instead of <> and this leads > to a problem. This works for me: > > update stamm > set code = replace (code, 'k' , '') > where code like '%k%' and code <> '%V%'; > > I would still be interested to learn how to update a row when the result > set is only reachable via a join. You can use 'FROM' in an update statement to include other tables. For example (doing a pointless self join): UPDATE stamm SET code = replace (code, 'k' , '') FROM stamm a WHERE a.code = code ;
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера