使用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 ; 錯誤
轉自
使用SQL中的update更新多個字段值 - 開心萌小小 - 博客園 https://www.cnblogs.com/pistachio123/p/8532525.html