Hi
Please help, we are using postgreSQL 9.2.4.
I need to update over 9000 rows. See the query below: A table
called contact has got addr_id field as null which is
incorrect. So now I need to update contact table for each
account (cus_acno is in cus table) where contact_addr_id is
null. For example using the first of the results below: I need
take set addr_id (in contact table) to 187479 where cus_acno
= 243492 and con_id = 119360
Example:
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 null;
cus_acno | con_id | addr_id
----------+--------+---------
243492 | 119360 | 187479
393701 | 119824 | 458532
388538 | 118413 | 453178
Thanks