Re: [GENERAL] Correct update statement

2014-05-15 Thread Khangelani Gama
Thank very much *From:* pgsql-general-ow...@postgresql.org [mailto: pgsql-general-ow...@postgresql.org] *On Behalf Of *Sim Zacks *Sent:* Thursday, May 15, 2014 10:42 AM *To:* pgsql-general@postgresql.org *Subject:* Re: [GENERAL] Correct update statement update contacts set addr_id=b.addr_id

Re: [GENERAL] Correct update statement

2014-05-15 Thread Sim Zacks
update contacts set addr_id=b.addr_id from (select distinct(cus_acno), contact.con_id, address.addr_id from address join person using (addr_id) join  cus using (per_id) join link_contact using (cus_acno) join contact using (con_id) where contact.addr_id is