Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

SQL Update latest column in master table from transaction table

$
0
0
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

Viewing all articles
Browse latest Browse all 13329

Trending Articles