有一张表 test,大致字段为下
id int(10)
name varchar(255)
email varchar(255)
update test set email = '[email protected]' where name=0; update test set email = '[email protected]' where name=false;
我们的 name 字段在数据库为字符串,但当我们 sql 中让 name 字段等于一个 int 0 或 boole false 时, 都会导致把所有数据都更新,请教下是因为什么?