Re: Subqueryes

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: "Ezequias R(dot) da Rocha" <ezequias(at)fastcon(dot)com(dot)br>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Subqueryes
Date: 2007-03-22 14:07:53
Message-ID: 43032.77931.qm@web31803.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

>
> update myTable
> set date = (current_date + (Select daysToAdd from base.Table1 where
> myFKey_id = Table1Id) )
> where Expire_Date = now()::Date;

Does this work: http://www.postgresql.org/docs/8.2/interactive/sql-update.html

UPDATE myTable
SET date = current_date + B.daysToAdd
FROM Table1 B
WHERE myFKey_id = B.Table1Id;

Regards,
Richard Broersma Jr.

In response to

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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Ezequias R. da Rocha 2007-03-22 14:42:20 Re: Subqueryes
Previous Message Alvaro Herrera 2007-03-22 13:56:39 Re: Subqueryes