【问题标题】:Result consisted of more than one row结果包含多于一行
【发布时间】:2013-12-16 07:57:23
【问题描述】:

我运行了两个简单的查询,但 MySQL 显示错误消息并且不明白为什么。

选择:

SELECT proy_obs FROM proy WHERE proy_cod = 'C-12-001';
+-------------+
| proy_obs    |
+-------------+
|             |
+-------------+
1 row in set (0.00 sec)

更新:

UPDATE proy SET proy_obs = 'Test' WHERE proy_cod = 'C-12-001';
ERROR 1172 (42000): Result consisted of more than one row

MySQL 版本:

mysql  Ver 14.14 Distrib 5.1.71, for redhat-linux-gnu (x86_64) using readline 5.1

【问题讨论】:

  • 您检查过“相关”列中的链接吗?
  • 是的,但我看到使用连接、分组和子选择的更复杂的查询。
  • 这篇文章可能是解决方案:stackoverflow.com/questions/12076360/…Thanks Alma Do.

标签: mysql sql triggers


【解决方案1】:

看起来您的表上定义了导致问题的触发器。

检查一下运行

select trigger_name 
  from information_schema.triggers 
 where trigger_schema = schema()
   and event_object_table = 'proy';

【讨论】:

  • 有一个与表“proy”关联的触发器。谢谢@peterm。
猜你喜欢
  • 2014-11-30
  • 1970-01-01
  • 2023-03-21
  • 2012-03-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-03-21
相关资源
最近更新 更多