出現這個問題的原因網上有說是update的參數連接符要用,而不是and,但是我遇到的不是這個。
我出現問題的原因是,在update語句的where中varchar類型的字段我直接用了數字類型
update address set province = '北京' where userId = 250;
userId是varchar類型的,報錯Data truncation: Truncated incorrect DOUBLE value: 'null'
改成這樣就可以了
update address set province = '北京' where userId = concat(250);