Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W45Li-0003Oy-CV for pgsql-php@arkaria.postgresql.org; Fri, 17 Jan 2014 09:04:22 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1W45Lh-0000E1-Hw for pgsql-php@arkaria.postgresql.org; Fri, 17 Jan 2014 09:04:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W45Lg-0000Du-JS for pgsql-php@postgresql.org; Fri, 17 Jan 2014 09:04:20 +0000 Received: from hawk069.startdedicated.com ([50.30.34.22] helo=smtp1.morphoss.com) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W45Lc-0000qX-PQ for pgsql-php@postgresql.org; Fri, 17 Jan 2014 09:04:20 +0000 Received: from localhost (localhost [127.0.0.1]) by smtp1.morphoss.com (Postfix) with ESMTP id AC9D54008E for ; Fri, 17 Jan 2014 04:04:12 -0500 (EST) Received: from smtp1.morphoss.com ([127.0.0.1]) by localhost (mail.hawk.morphoss.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id XSUqTHVLg3iE for ; Fri, 17 Jan 2014 04:04:12 -0500 (EST) Received: from [192.168.55.26] (202-160-51-156.knossos.net.nz [202.160.51.156]) (Authenticated sender: andrew@morphoss.com) by smtp1.morphoss.com (Postfix) with ESMTPSA id C6ABB4008A for ; Fri, 17 Jan 2014 04:04:11 -0500 (EST) Message-ID: <1389949451.3503.33.camel@narbon.home.mcmillan.net.nz> Subject: Re: UPDATE (SELECT ) is not working................ From: Andrew McMillan To: pgsql-php@postgresql.org Date: Fri, 17 Jan 2014 22:04:11 +1300 In-Reply-To: References: Organization: Morphoss Ltd Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.8.5-2+b1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-php Precedence: bulk Sender: pgsql-php-owner@postgresql.org On Fri, 2014-01-17 at 13:58 +0530, Archana K N wrote: > Hello, > > > I am trying to update a database with values from another . Am > using Debain(Linux) OS. > > > When I try to update no error is displayed. But column is not > updated. > I am using the psql console for querying. > > > my code is as follows(along with result):- > > > ""my_db=# update test set id=g.id2 from (select id2 from test2)as g ; > UPDATE 0 Your SQL does not do what you think it does. You should probably test your SQL at the psql command line to figure out the correct way to do what you want to do before you try and post to a PHP mailing list about this kind of thing. I'd offer advice, but I can't figure out from your statement what you're trying to do your database either. Cheers, Andrew. -- ------------------------------------------------------------------------ andrew (AT) morphoss (DOT) com +64 (2) 7233 2426 IOT trap -- core dumped ------------------------------------------------------------------------ -- Sent via pgsql-php mailing list (pgsql-php@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-php