delete from t_user
> 1175 - you are using safe update mode and you tried to update a table without a where that uses a key column
> 时间: 0.001s
update t_user set name='123'
update t_user set name='123'
> 1175 - you are using safe update mode and you tried to update a table without a where that uses a key column
> 时间: 0.001s
2、非索引键的delete
delete from t_user where name='123'
delete from t_user where name='123'
> 1175 - you are using safe update mode and you tried to update a table without a where that uses a key column
> 时间: 0.007s
如果delete的where条件不是索引键,则必须要添加limit才可以。
delete from t_user where name='123' limit 1
delete from t_user where name='123' limit 1
> affected rows: 0
> 时间: 0.002s
3.索引键的delete
delete from t_user where group_id='123'
delete from t_user where group_id='123'
> affected rows: 0
> 时间: 0s