SQL update from one Table to another based on a ID match

后端 未结 22 1341
太阳男子
太阳男子 2020-11-21 22:49

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

22条回答
  •  走了就别回头了
    2020-11-21 23:13

    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
    );
    

提交回复
热议问题