pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@commandprompt.com>
To: Ezequias R. da Rocha <ezequias@fastcon.com.br>
Cc: pgsql-sql@postgresql.org
Subject: Re: Subqueryes
Date: Thu, 22 Mar 2007 09:56:39 -0400
Message-ID: <20070322135639.GE4102@alvh.no-ip.org> (raw)
In-Reply-To: <46028915.1030102@fastcon.com.br>
References: <46028915.1030102@fastcon.com.br>

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.



view thread (4+ messages)  latest in thread

Message-ID: <20070322135639.GE4102@alvh.no-ip.org>
Permalink:  ../20070322135639.GE4102@alvh.no-ip.org/
Also on:    postgresql.org/message-id/20070322135639.GE4102@alvh.no-ip.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: alvherre@commandprompt.com, ezequias@fastcon.com.br
  Subject: Re: Subqueryes
  In-Reply-To: <20070322135639.GE4102@alvh.no-ip.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox