Re: Subqueryes

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Subqueryes
Дата
Msg-id 20070322135639.GE4102@alvh.no-ip.org
обсуждение исходный текст
Ответ на Subqueryes  ("Ezequias R. da Rocha" <ezequias@fastcon.com.br>)
Список pgsql-sql
Ezequias R. da Rocha wrote:
> Hi list,
> 
> I must add some days (i.e:365) to my current_date and put it in my table 
> (an UPDATE). By now, it is simple but my "days to add" is in another table.
> 
> How could I do this kind of update
> 
> My sql is like this (but is not working):
> 
> update myTable
> set date = (current_date + (Select daysToAdd from base.Table1 where 
> myFKey_id = Table1Id) )
> where Expire_Date = now()::Date;

So what is the error message?

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


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

Предыдущее
От: "Ezequias R. da Rocha"
Дата:
Сообщение: Subqueryes
Следующее
От: Richard Broersma Jr
Дата:
Сообщение: Re: Subqueryes