Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 568E69FB539 for ; Thu, 22 Mar 2007 11:44:51 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 91433-05-2 for ; Thu, 22 Mar 2007 11:44:35 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from correio2.docasdoporto.com.br (8.144.199.200.docasdoporto.com.br [200.199.144.8]) by postgresql.org (Postfix) with ESMTP id A5CB49FB55D for ; Thu, 22 Mar 2007 11:44:37 -0300 (ADT) Received: from [201.30.172.2] (account ezequias@fastcon.com.br HELO [192.168.0.110]) by correio2.docasdoporto.com.br (CommuniGate Pro SMTP 4.1.8) with ESMTP-TLS id 47102824; Thu, 22 Mar 2007 12:02:11 -0300 Message-ID: <460295CC.7030603@fastcon.com.br> Date: Thu, 22 Mar 2007 11:42:20 -0300 From: "Ezequias R. da Rocha" User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: Richard Broersma Jr CC: pgsql-sql@postgresql.org Subject: Re: Subqueryes References: <43032.77931.qm@web31803.mail.mud.yahoo.com> In-Reply-To: <43032.77931.qm@web31803.mail.mud.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200703/301 X-Sequence-Number: 27939 Perfect quite nice. I am doing things that I could not believe I could do without the community. Thank you so much. -- Atenciosamente Ezequias Rodrigues da Rocha Richard Broersma Jr escreveu: >> 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. > > > ---------------------------(end of broadcast)--------------------------- > TIP 6: explain analyze is your friend > >