Update latest column in master table from transaction table - Mailing list pgsql-general

From Arvind Singh
Subject Update latest column in master table from transaction table
Date
Msg-id BLU164-W48177FDA355AF82B9046C1CA660@phx.gbl
Whole thread Raw
Responses Re: Update latest column in master table from transaction table  (Igor Romanchenko <igor.a.romanchenko@gmail.com>)
List pgsql-general
hello,
 
i have two tables
customer_master
> cname
> lastreceiptdate
> lastreceiptamt
accounts
> cname
> date
> amount
 
i need help in constructing a single update query. where the customer_master table is updated with the latest receipt date and receipt amount for a single customer code (cname like "FRUITXXXXX") from accounts table
 
so far we are using a select command to retrieve a record with max(Date) and then using another update command to update using results from the select query.
 
thanks

 

pgsql-general by date:

Previous
From: Craig Ringer
Date:
Subject: Re: role does not exist
Next
From: Yvon Thoraval
Date:
Subject: PostgreSQL and IPV6