mySQL UPDATE query returns quot;0 rows affectedquot;(mySQL UPDATE 查询返回“0 行受影响;)
问题描述
我有这个问题:
UPDATE phonecalls
SET Called = "Yes"
WHERE PhoneNumber = "999 29-4655"
我的表是 phonecalls,我有一个名为 PhoneNumber 的列.我只想更新一个名为 Called 为yes"的列.
My table is phonecalls, I have a column named PhoneNumber. All I want to update is a column named Called to "yes".
知道我做错了什么吗?当我返回查询时,它显示 0 行受影响.
Any idea what I am doing wrong? when I return my query it says 0 rows affected.
推荐答案
按照安非他明和雅达的建议,使用 SELECT 检查您的电话号码是否在表格中.
As amphetamine and Yada suggested, check with a SELECT, if your phone number is in the table.
但请记住:如果相关行的 调用 的值已经是是",mysql 不会更改该值,因此将返回0 行受影响".所以一定要检查 called
But keep in mind: If the value for called of the row in question is already "Yes", mysql won't change the value and will therefore return "0 rows affected". So be sure to also check the current value of called
这篇关于mySQL UPDATE 查询返回“0 行受影响";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:mySQL UPDATE 查询返回“0 行受影响";
基础教程推荐
- mysql选择动态行值作为列名,另一列作为值 2021-01-01
- 在多列上分布任意行 2021-01-01
- MySQL 中的类型:BigInt(20) 与 Int(20) 2021-01-01
- 如何根据该 XML 中的值更新 SQL 中的 XML 2021-01-01
- 表 './mysql/proc' 被标记为崩溃,应该修复 2022-01-01
- 二进制文件到 SQL 数据库 Apache Camel 2021-01-01
- 在 MySQL 中:如何将表名作为存储过程和/或函数参数传递? 2021-01-01
- oracle区分大小写的原因? 2021-01-01
- 什么是 orradiag_<user>文件夹? 2022-01-01
- 如何在 SQL 中将 Float 转换为 Varchar 2021-01-01
