本文主要是讲解SQL中update更新多个字段的注意点
使用SQL中的update更新多个字段值,set后面的条件要用逗号不能用and set后面的多个条件之间没有关联也不可以有关联,所以就不能用and了;where 条件后面 可以为and 如: update table set sex= '男', name='思源' where id = 1 ; 正确 update table set sex= '男' and name='思源' where id = 1 ; 错误
文章到此结束,希望大家喜欢