getting rid of "Adding missing FROM-clause entry...."

From: Rajesh Kumar Mallah <mallah(at)trade-india(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: getting rid of "Adding missing FROM-clause entry...."
Date: 2003-04-17 10:27:47
Message-ID: 200304171557.47319.mallah@trade-india.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


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.

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Mr.F 2003-04-17 11:15:15 1st Posgresql Dump for Win !
Previous Message Rajesh Kumar Mallah 2003-04-17 10:00:45 Re: IN Qeury Problem