X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 70FE44758F1 for ; Thu, 17 Apr 2003 06:27:48 -0400 (EDT) Received: from rtlocal.trade-india.com (mail-relay.trade-india.com [203.196.129.235]) by postgresql.org (Postfix) with SMTP id C6A77475458 for ; Thu, 17 Apr 2003 06:27:44 -0400 (EDT) Received: (qmail 14433 invoked from network); 17 Apr 2003 10:30:36 -0000 Received: from system67.trade-india-local.com (192.168.0.67) by infocom-236-129-del.trade-india.com with SMTP; 17 Apr 2003 10:30:36 -0000 From: Rajesh Kumar Mallah Organization: Infocom Network Limited To: pgsql-sql@postgresql.org Subject: getting rid of "Adding missing FROM-clause entry...." Date: Thu, 17 Apr 2003 15:57:47 +0530 User-Agent: KMail/1.5 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200304171557.47319.mallah@trade-india.com> X-Spam-Status: No, hits=-7.2 required=5.0 tests=BAYES_01,SIGNATURE_SHORT_SPARSE,USER_AGENT version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/261 X-Sequence-Number: 12962 Hi I am having problem with an UPDATE ... FROM SQL where the FROM table is a subquery. UPDATE profile_master set title1=a.title1 FROM ( SELECT company_id , titile as title1 ,fname as fname1 ,mname as mname1 ,lname as lname1 ,company_position as desg1 from public.catalog_key_contacts where company_id=profile_master.company_id order by contact_id limit 1 offset 0 ) as a where profile_master.source='CATALOG' ; NOTICE: Adding missing FROM-clause entry in subquery for table "profile_master" UPDATE 711 its showing an update of 711 however all the 711 matching rows are getting updated to the same value. can anyone tell me how to write this query properly ? Regds Mallah. -- Rajesh Kumar Mallah, Project Manager (Development) Infocom Network Limited, New Delhi phone: +91(11)6152172 (221) (L) ,9811255597 (M) Visit http://www.trade-india.com , India's Leading B2B eMarketplace.