Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: ER_WRONG_VALUE_COUNT_ON_ROW: Column count doesn't match value count at row 1

Tags:

sql

mysql

INSERT INTO MediaTrackInactive(MediaTrackInactiveID, PrimaryCategoryID, Title, Source, AnchorName, ProducedBy, CoverageID, Content, AudioLength, IsLead, CreationTime, UploadTime, StoryTypeID, IsPending)  
VALUES(103257 , '10', 'How does the US make the case for its interests in Ukraine?', 'NewsHour, PBS NewsHour, News', '1', 'Reporting from the Aspen Ideas Festival in Colorado, Hari Sreenivasan interviews the former American Ambassador to Russia, Michael McFaul, in a conversation focused on the crisis in Ukraine and its impact on U.S.-Russian relations.', '365', '', 1404602224000, 1404689273287, 2, 0)

While trying to execute the above query the following error is coming Error: ER_WRONG_VALUE_COUNT_ON_ROW: Column count doesn't match value count at row 1 I really don't understand what I'm doing wrong Thanks

like image 365
Kishore Indraganti Avatar asked Jul 16 '14 05:07

Kishore Indraganti


People also ask

How to fix column count doesn t match value count at row 1?

To resolve this “Column count doesn't match value count at row 1” error, you have to ensure that the columns in the table or your INSERT statement match the values you are inserting. The best way to do this is to specify the columns you want in your INSERT statement and ensure the VALUES clause matches the column list.

Could not INSERT record column count doesn t match value count at row 1?

Column count doesn't match value count at row 1. That error message typically means the number of values provided in the INSERT statement is bigger or smaller than the number of columns the table has, while at the same time, you did not specify the columns to be inserted.

How do I fix error 1136 in MySQL?

To fix this issue, make sure you're inserting the correct number of columns into the table. Alternatively, you can name the columns in your INSERT statement so that MySQL knows which columns your data needs to be inserted into.


2 Answers

You are providing less values than you have mentioned.

You have mentioned 14 column names and you are providing values for only 12 columns.

like image 139
Prateek Mishra Avatar answered Oct 01 '22 14:10

Prateek Mishra


You have specified more columns than values. I guess some ' is missing.

Maybe here: 'PBS NewsHour, PBS NewsHour, Rivet',

like image 26
Jens Avatar answered Oct 01 '22 15:10

Jens