2019-07-19技术几秒 读完 (大约 47 个字) 0次访问sql update set使用case when语句示例一: 123456789101112UPDATE `table` SET `djyzmdm` = NULL,`djyzmsj` = NULL,`dlcs` =CASE WHEN `dlcs` IS NULL THEN 1 ELSE `dlcs` + 1 END WHERE `id` = 1 示例二: 1234567891011121314UPDATE `table` SET `datetime` = 1434567890,`status` =CASE `id` WHEN 12 THEN 1 WHEN 13 THEN 2 WHEN 14 THEN 3 END WHERE `id` IN (12,13,14) #mysqlsqlcase when