嵌套查詢步驟
以修改用戶為** 的 省份為上海
步驟拆解
- 確定用戶
SELECT cst_id
FROM t_user_user
WHERE user_name='wzj1234' - 確定后續(xù)過濾條件
UPDATE t_cst_customer SET province ='上海' WHERE cst_id = ()
- 組合
UPDATE t_cst_customer SET province ='上海' WHERE cst_id = (
SELECT cst_id
FROM t_user_user
WHERE user_name='wzj1234'
)

image.png