티스토리 뷰
728x90
UPDATE table_users
SET cod_user = (case when user_role = 'student' then '622057'
when user_role = 'assistant' then '2913659'
when user_role = 'admin' then '6160230'
end),
date = '12082014'
WHERE user_role in ('student', 'assistant', 'admin') AND
cod_office = '17389551';
MySQL - UPDATE multiple rows with different values in one query
I am trying to understand how to UPDATE multiple rows with different values and I just don't get it. The solution is everywhere but to me it looks difficult to understand. For instance, three upda...
stackoverflow.com
728x90
'공부' 카테고리의 다른 글
[Python] counter (0) | 2020.04.26 |
---|---|
[Git] pull & push don't ask password (0) | 2020.04.26 |
[MySQL] update by multiple condition (0) | 2020.04.26 |
[Python] split string to char (0) | 2020.04.26 |
[Maven] MissingProjectException (0) | 2020.04.26 |
[Java] Spring Boot jar (0) | 2020.04.26 |
댓글