mysql update select

mysql与orale语法不一致,mysql一次可以更新多个表,依据这个特性,可以用以下变通方法实现update select.

UPDATE TEST SA,
(
    SELECT
        SU.userid,
        SU. PASSWORD
    FROM
        SEC_USER SU
    WHERE
        SU.userid = 'cjf'
) SU1
SET SA. usercode = SU1.userid,
SA. password = SU1. PASSWORD
WHERE
    SUBSCRIBE_ASK_ID = 'SAI201401151108410029'

你可能感兴趣的:(mysql update select)