티스토리 뷰

공부

[mysql] upsert (ON DUPLICATE KEYUPDATE)

승가비 2024. 2. 4. 19:03
728x90
INSERT INTO user_refresh_token (user_id, refresh_token)
VALUES (#{userId}, #{refreshToken}) ON DUPLICATE KEY
UPDATE refresh_token = #{refreshToken}

https://devlog-wjdrbs96.tistory.com/365

 

[MySQL] Upsert 쿼리란 무엇일까?

MySQL Upsert 사용법 이번 글에서는 MySQL에서 Upsert 쿼리를 사용하는 법에 대해서 정리해보겠습니다. Upsert는 이름에서 어느정도 유추할 수 있듯이 Update + Insert를 합친 말입니다. 즉, Upsert는 중복되는

devlog-wjdrbs96.tistory.com

 

728x90

'공부' 카테고리의 다른 글

[tree] -d  (0) 2024.02.04
[python] os.path  (0) 2024.02.04
[airflow] mysql operator pipeline  (0) 2024.02.04
[linux] check if str is null  (0) 2024.02.04
[mysql] change port not working  (0) 2024.02.04
댓글