gpt4 book ai didi

mysql - 没有子查询的更新抛出错误 : Subquery returns more than 1 row

转载 作者:行者123 更新时间:2023-11-29 01:59:36 25 4
gpt4 key购买 nike

有人能给我解释一下吗……:)(使用 MySQL 5.6.13)

UPDATE offer SET cosid=1 WHERE id=40;
Query OK, 1 row affected (0.07 sec)
Rows matched: 1 Changed: 1 Warnings: 0

UPDATE offer SET cosid=4 WHERE id=40;
ERROR 1242 (21000): Subquery returns more than 1 row

UPDATE offer SET cosid=5 WHERE id=40;
Query OK, 1 row affected (0.04 sec)
Rows matched: 1 Changed: 1 Warnings: 0

每个有效索引都被接受,除了四个 :(

这是报价表:

CREATE TABLE offer (
id bigint(20) NOT NULL AUTO_INCREMENT,
authorid bigint(20) NOT NULL,
offered_designid bigint(20) NOT NULL,
cdid bigint(20),
cosid bigint(20) NOT NULL,
PRIMARY KEY (id),
UNIQUE INDEX (id)) ENGINE=InnoDB;

有什么建议可能是错误的吗?

已编辑:这是当前的 cos 表:

SELECT * FROM cos;
+----+-------------+
| id | offer_state |
+----+-------------+
| 1 | active |
| 5 | cancelled |
| 3 | inactive |
| 4 | realized |
| 2 | waiting |
+----+-------------+

集合中有 5 行(0.00 秒)

最佳答案

正如 ypercube 在评论中所述,并且您已经确认,触发器是这里的罪魁祸首!

关于mysql - 没有子查询的更新抛出错误 : Subquery returns more than 1 row,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18708376/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com