使用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 ;    错误

 

转自

使用SQL中的update更新多个字段值 - 开心萌小小 - 博客园 https://www.cnblogs.com/pistachio123/p/8532525.html

 

posted @ 2020-09-11 16:20  paul_hch  阅读(2390)  评论(0编辑  收藏  举报