使用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刪除。