关于mysql:Django-orm-批量更新对应的-SQL-语句

29次阅读

共计 235 个字符,预计需要花费 1 分钟才能阅读完成。

UPDATE
    `workingImdbMatchTask`
SET
    `task_json` = CASE
        WHEN (`workingImdbMatchTask`.`id` = 5) THEN 'asds'
        WHEN (`workingImdbMatchTask`.`id` = 8) THEN 'asds'
        WHEN (`workingImdbMatchTask`.`id` = 9) THEN 'asds'
        ELSE NULL
    END
WHERE
    `workingImdbMatchTask`.`id` IN (5, 8, 9);

正文完
 0