๋ฐ์ํ
MySQL Update Join
- Oracle Merge Into๋ฌธ์ MySQL๋ก ๋ณํํ๋ค๊ฐ Update๋ฌธ์ Join์ ์ ์ธ ์ ์๋ค๋ ์ฌ์ค์ ์๊ฒ ๋์๋ค.
UPDATE support_table A INNER JOIN member_table B ON A.sp_uid = B.user_id
SET B.level=7
WHERE B.level=9 AND A.support_money > 10000
-- UPDATE ํ์ํ
์ด๋ธ A INNER JOIN ํ์ํ
์ด๋ธ B
-- ON A.ํ์์์ด๋ = B.ํ์์์ด๋
-- SET B.ํ์๋ฑ๊ธ = 7
-- WHERE B.ํ์๋ฑ๊ธ = 9 AND A.ํ์๊ธ >= 10000
๐ Reference
๋๋ณด๊ธฐ
http://www.joshi.co.kr/index.php?mid=board_iuyq53&document_srl=295026
https://aspdotnet.tistory.com/1833
https://whiterussian.tistory.com/59
1. update join
2. update group by
3. update sub query
๋ฐ์ํ