pistachio123

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

 

修改字段值为当前时间

update table set time1=now(),time2=now();


分类:

技术点:

相关文章:

  • 2021-11-04
  • 2021-10-19
  • 2021-11-04
  • 2021-11-19
  • 2021-11-17
  • 2021-09-14
  • 2021-10-20
猜你喜欢
  • 2021-11-14
  • 2021-09-29
  • 2021-11-17
  • 2021-10-19
  • 2021-10-02
  • 2021-11-02
相关资源
相似解决方案