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
it works with postgresql
UPDATE application SET omts_received_date = ( SELECT date_created FROM application_history WHERE application.id = application_history.application_id AND application_history.application_status_id = 8 );