Subqueryes

From: "Ezequias R(dot) da Rocha" <ezequias(at)fastcon(dot)com(dot)br>
To: pgsql-sql(at)postgresql(dot)org
Subject: Subqueryes
Date: 2007-03-22 13:48:05
Message-ID: 46028915.1030102@fastcon.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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;

--
Atenciosamente
Ezequias Rodrigues da Rocha

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Alvaro Herrera 2007-03-22 13:56:39 Re: Subqueryes
Previous Message Susan Evans 2007-03-22 11:55:55 unsubscribe