Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

mysql - ERROR 1136: Column count doesn't match value count at row 1

I get the Error:

Column count doesn't match value count at row 1.

But I've checked and rechecked my query and everything seems ok:

UPDATE
    table
SET
    col = 'enum(''FOO'',''BAR'')'
WHERE
    col1 = ''
AND
    col2 = 'val2'
AND
    col3 = 3;

I thought the table could have some triggers that were generating the error –I didn't design the system– but I can't find any.

I've found the same error with at least three different tables.

Note. The "enum" on line three is really supposed to be a string, not an enum type.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

It could be a few things, but here are two ideas:

-There is a trigger that needs to be changed/removed.

-The value that you are updating the cell to exceeds the column length. Article on this.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.7k users

...