DBAtlas · Database operations atlas

1136: Column count doesn't match value count

MySQL

What does it mean?

The number of columns in the INSERT statement does not match the number of values in the VALUES list. Each column must get exactly one value.

Why does it happen?

The column list and the value list in an INSERT having different lengths; in an INSERT without a column list, the values not matching the table's column count; a missing/extra comma; the table structure changed but the script was not updated.

How to fix it

Make the column count and value count equal. Always use an explicit column list: INSERT INTO my_table (a, b, c) VALUES (1, 2, 3); Check the table structure: DESCRIBE my_table; Match the values one-to-one with the columns and fix extra/missing commas.

Open in DBAtlas →

More from this engine