sách gpt4 ăn đã đi

mysql - 为什么 Mysql 在更新查询时返回错误代码 1241?

In lại Tác giả: Walker 123 更新时间:2023-11-29 16:40:29 25 4
mua khóa gpt4 giày nike

我使用的是 Mysql Workbench 8.0.12,我有一个包含三列的表 (tblproduct):

idProduction INT PK AI
dateProduction DATETIME
statusProduction VARCHAR(15)

当我尝试更改 statusProduction 列的值时,例如,将“queue”更改为“done”,如下面的查询所示(SELECT、INSERT 和 DELETE 查询都可以):

UPDATE tblproduction 
SET statusProduction = 'done'
WHERE idProduction=1;

系统返回“错误代码:1241。操作数应包含 1 列。”我做了一些研究,发现这个错误代码与语法错误有关,但我在查询中没有发现任何问题。

如果我尝试做这样的事情:

UPDATE tblproduction 
SET statusProduction = 'done'
WHERE idProduction='a';

尽管有 0 行受到影响,系统实际上运行了查询,但如果我尝试这样做,它会给出相同的错误消息:

UPDATE tblproduction 
SET statusProduction = 'done'
WHERE idProduction='1';

我真的不知道出了什么问题,我知道这是一个愚蠢的问题,但如果有人可以帮助我。

câu trả lời hay nhất

 please try using this method :      
I have created a table and inserted the record like this :
select * from tblproduction;
+--------------+---------------------+------------------+
| idProduction | dateProduction | statusProduction |
+--------------+---------------------+------------------+
| 1 | 2018-11-19 08:22:11 | queue |
+--------------+---------------------+------------------+

use update query :
UPDATE `test`.`tblproduction` SET `statusProduction` = 'done' WHERE `tblproduction`.`idProduction` =1;

got result :
--------------+---------------------+------------------+
| idProduction | dateProduction | statusProduction |
+--------------+---------------------+------------------+
| 1 | 2018-11-19 08:22:11 | done |
+--------------+---------------------+------------------+

关于mysql - 为什么 Mysql 在更新查询时返回错误代码 1241?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53366418/

25 4 0
Walker 123
Hồ sơ

Tôi là một lập trình viên xuất sắc, rất giỏi!

Nhận phiếu giảm giá taxi Didi miễn phí
Phiếu giảm giá taxi Didi
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress