mySQL UPDATE 查询返回“0 行受影响";

mySQL UPDATE query returns quot;0 rows affectedquot;(mySQL UPDATE 查询返回“0 行受影响;)
本文介绍了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 行受影响";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Hibernate reactive No Vert.x context active in aws rds(AWS RDS中的休眠反应性非Vert.x上下文处于活动状态)
Bulk insert with mysql2 and NodeJs throws 500(使用mysql2和NodeJS的大容量插入抛出500)
Flask + PyMySQL giving error no attribute #39;settimeout#39;(FlASK+PyMySQL给出错误,没有属性#39;setTimeout#39;)
auto_increment column for a group of rows?(一组行的AUTO_INCREMENT列?)
Sort by ID DESC(按ID代码排序)
SQL/MySQL: split a quantity value into multiple rows by date(SQL/MySQL:按日期将数量值拆分为多行)