Re: Subqueryes

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: "Ezequias R(dot) da Rocha" <ezequias(at)fastcon(dot)com(dot)br>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Subqueryes
Date: 2007-03-22 13:56:39
Message-ID: 20070322135639.GE4102@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

  • Subqueryes at 2007-03-22 13:48:05 from Ezequias R. da Rocha

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Broersma Jr 2007-03-22 14:07:53 Re: Subqueryes
Previous Message Ezequias R. da Rocha 2007-03-22 13:48:05 Subqueryes