I have a database with account numbers and card numbers. I match these to a file to update any card numbers to the account number, so
account numbers
card numbers
update
For PostgreSQL:
UPDATE Sales_Import SI SET AccountNumber = RAN.AccountNumber FROM RetrieveAccountNumber RAN WHERE RAN.LeadID = SI.LeadID;