// MySQL error reference

MySQL error 1136: Column count doesn't match value count

An INSERT gives a different number of values than columns: the column list and the VALUES row (or the SELECT) don't line up.

Error number
1136
Name
ER_WRONG_VALUE_COUNT_ON_ROW
SQLSTATE
21S01
Category
Syntax and statements
Error message
Column count doesn't match value count at row %ld

What it means

Each row in VALUES, or each row of an INSERT ... SELECT, must have exactly one value per target column. Without a column list, the target is every column of the table, in table order. 1136 names the first row that doesn't fit.

Common causes

  • INSERT INTO t VALUES (...) without a column list, after a column was added to the table.
  • A missing or extra value, or a stray comma.
  • INSERT ... SELECT whose select list has a different number of columns.

How to fix it

  1. Always name the columns, so later schema changes don't break the statement.

    INSERT INTO customers (name, email) VALUES ('Ada', '[email protected]');
  2. Check the table's columns and their order.

    SHOW COLUMNS FROM customers;

Reproduce it safely

CREATE TEMPORARY TABLE t (a INT, b INT);
INSERT INTO t VALUES (1);  -- ERROR 1136 (21S01)

Related errors

More syntax and statements errors

The code and message text are from the MySQL 8.4 Error Message Reference. Browse the full MySQL error list or search every database error.

// fewer errors, faster fixes

Work on MySQL in SQLly

A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for MySQL and the other databases you use.