使用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更新多个字段值,set后面的条件要用逗号不能用and
set后面的多个条件之间没有关联也不可以有关联,所以就不能用and了;where 条件后面 可以为and
如:
update table set sex= '男', name='张三' where id = 1 ; 正确
update table set sex= '男' and name='张三' where id = 1 ; 错误
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。