| От | Christoph Haller |
|---|---|
| Тема | Re: Variables in PSQL |
| Дата | |
| Msg-id | 200207101100.NAA06951@rodos обсуждение исходный текст |
| Ответ на | Variables in PSQL ("Roger Mathis" <traderx@gmx.ch>) |
| Список | pgsql-sql |
> > I'm trying to declare a variable in PostgreSQL, so I can save some values in > it. After, I want to calculate with this variable. > For example: > > declare vp integer; > select price into :vp from article where anr = 1; > vp := vp + 1; > update article set price = :vp where anr = 1; AFAIK, you can do stuff like this only within a function. > > Is there a posibility to do that without creating a funktion? What about update article set price =(select price + 1 from article where anr = 1) where anr = 1; Regards, Christoph
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера