
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
Fix Error 1136: Column count doesn't match value count at row 1?
You may get tis value, if you are missing the value for auto_increment column. The error is as follows −
mysql> insert into DemoTable1353 values('Chris',23); ERROR 1136 (21S01): Column count doesn't match value count at row 1
You need to provide the value for auto_increment or leave it to automatic generation.
Let us see an example and create a table −
mysql> create table DemoTable1353 -> ( -> Id int NOT NULL AUTO_INCREMENT, -> Name varchar(20), -> Age int, -> PRIMARY KEY(Id) -> ); Query OK, 0 rows affected (0.52 sec)
Insert some records in the table using insert command. We haven’t inserted auto increment value and it will generate on its own −
mysql> insert into DemoTable1353(Name,Age) values('Chris',23); Query OK, 1 row affected (0.30 sec) mysql> insert into DemoTable1353(Name,Age) values('David',21); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable1353(Name,Age) values('Bob',24); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable1353(Name,Age) values('John',47); Query OK, 1 row affected (0.11 sec)
Display all records from the table using select statement −
mysql> select * from DemoTable1353;
This will produce the following output −
+----+-------+------+ | Id | Name | Age | +----+-------+------+ | 1 | Chris | 23 | | 2 | David | 21 | | 3 | Bob | 24 | | 4 | John | 47 | +----+-------+------+ 4 rows in set (0.00 sec)
- Related Articles
- Resolve the error Column count doesn’t match value count in MySQL?
- Count the same value of each row in a MySQL column?
- How to get Row and Column Count from ResultSet in JDBC
- CSS3 Multi-Column column-count Property
- Count Negative Numbers in a Column-Wise and Row-Wise Sorted Matrix using Python?
- Count number of times value appears in particular column in MySQL?
- Animate CSS column-count property
- Count elements in a vector that match a target value or condition in C++
- Count the number of pairs that have column sum greater than row sum in C++
- Fix MySQL Database Error #1064?
- Count the frequency of a value in a DataFrame column in Pandas
- Fix Error in MySQL syntax while creating a table column with name “index”?
- How to add a column from a select query but the value from the new column will be the row count of the MySQL select query?
- How to get the row count in JDBC?
- JavaScript Get row count of an HTML table?

Advertisements