MYSQL 一个很奇怪的现象,有没有遇到过的兄弟帮忙解惑一下~
在mysql5.7版本中执行此sql语句
update `tables` set `title` = "xxxx", `sort` = "15", `status` = "1", `tables`.`updated_at` = "2022-08-28 20:13:04" where `id` = 1
结果显示
影响函数为1,但是影响的结果缺跟预期的不一样。
实际结果:tables表里面的所以记录的status都被更新为了1
期望结果:tables表记录为1的status更新为1
备注:status字段类型为tinyint 而sort字段类型为unsigned int ,把sql语句改成
update `tables` set `title` = "xxxx", `sort` = 15, `status` = 1, `tables`.`updated_at` = "2022-08-28 20:13:04" where `id` = 1
则正常预期。
有没有遇到过的大佬帮忙解惑解惑
推荐文章: