ERROR 1054 (42S22): Unknown column 'marks' in 'field list'

error 1054 (42s22) unknown column in 'where clause'
error 1054 unknown column in 'field list'
error 1054 (42s22): unknown column plugin in 'field list
42s22 1054 unknown column
error 1054 42s22 unknown column action in field list
mysql error 1054 unknown column in 'on clause
sql error: 1054, sqlstate: 42s22
1054 42s22: unknown column name in 'field list

This is a very simple MySQL query.

INSERT INTO users_questions (user_id, question_id, mcopt_id,timestamp) 
VALUES (50053, 875, 3092, '2015-08-22 18:01:44');

When I use it I get

ERROR 1054 (42S22): Unknown column 'marks' in 'field list'

marks is a column in the same table whose default value is set to NULL and in the above query I don't even use the column name marks.

So why exactly am i getting the error?

Structure of table:

+-------------+-----------+------+-----+-------------------+-------+
| Field       | Type      | Null | Key | Default           | Extra |
+-------------+-----------+------+-----+-------------------+-------+
| user_id     | int(11)   | NO   | PRI | NULL              |       |
| question_id | int(11)   | NO   | PRI | NULL              |       |
| mcopt_id    | int(11)   | NO   |     | NULL              |       |
| timestamp   | timestamp | NO   |     | CURRENT_TIMESTAMP |       |
| marks       | int(11)   | NO   |     | NULL              |       |
+-------------+-----------+------+-----+-------------------+-------+

Just to make it clear I also get the error when I provide the value of marks

 INSERT INTO users_questions (user_id, question_id, mcopt_id, timestamp, marks) VALUES (50053, 875, 3094, '2015-08-22 19:15:07', 1)

`

A:
create table users_questions2
(   user_id int not null,
    question_id int not null,
    mcopt_id int not null,
    timestamp timestamp not null,
    marks int not null
);
describe  users_questions2;
+-------------+-----------+------+-----+-------------------+-----------------------------+
| Field       | Type      | Null | Key | Default           | Extra                       |
+-------------+-----------+------+-----+-------------------+-----------------------------+
| user_id     | int(11)   | NO   |     | NULL              |                             |
| question_id | int(11)   | NO   |     | NULL              |                             |
| mcopt_id    | int(11)   | NO   |     | NULL              |                             |
| timestamp   | timestamp | NO   |     | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
| marks       | int(11)   | NO   |     | NULL              |                             |
+-------------+-----------+------+-----+-------------------+-----------------------------+

INSERT INTO users_questions2 (user_id, question_id, mcopt_id, timestamp) VALUES (50053, 875, 3092, '2015-08-22 18:01:44');

Error Code: 1364. Field 'marks' doesn't have a default value    0.047 sec

INSERT INTO users_questions2 (user_id, question_id, mcopt_id, timestamp,marks) VALUES (50053, 875, 3092, '2015-08-22 18:01:44',1);
-- 1 row(s) affected

INSERT INTO users_questions2 (user_id, question_id, mcopt_id, timestamp,marks) VALUES (50053, 875, 3092, '2015-08-22 18:01:44',null);
Error Code: 1048. Column 'marks' cannot be null 0.000 sec
B:
drop table users_questions2;

create table users_questions2
(   user_id int  null,
    question_id int  null,
    mcopt_id int  null,
    timestamp timestamp  null,
    marks int  null
);
describe  users_questions2;
+-------------+-----------+------+-----+---------+-------+
| Field       | Type      | Null | Key | Default | Extra |
+-------------+-----------+------+-----+---------+-------+
| user_id     | int(11)   | YES  |     | NULL    |       |
| question_id | int(11)   | YES  |     | NULL    |       |
| mcopt_id    | int(11)   | YES  |     | NULL    |       |
| timestamp   | timestamp | YES  |     | NULL    |       |
| marks       | int(11)   | YES  |     | NULL    |       |
+-------------+-----------+------+-----+---------+-------+
INSERT INTO users_questions2 (user_id, question_id, mcopt_id, timestamp) VALUES (50053, 875, 3092, '2015-08-22 18:01:44');

1 row(s) affected

So the only way I can get my describe table to look like yours is if they are not null columns (section A above). Which means your columns do not accept nulls.

Edit:
show variables like "%version%";
+-------------------------+------------------------------+
| Variable_name           | Value                        |
+-------------------------+------------------------------+
| innodb_version          | 5.6.24                       |
| protocol_version        | 10                           |
| slave_type_conversions  |                              |
| version                 | 5.6.24-log                   |
| version_comment         | MySQL Community Server (GPL) |
| version_compile_machine | x86_64                       |
| version_compile_os      | Win64                        |
+-------------------------+------------------------------+

ERROR 1054 (42S22): Unknown column 'marks' in 'field list', ERROR 1054 (42S22): Unknown column 'marks' in 'field list'. marks is a column in the same table whose default value is set to NULL and in the above query I� Author Shahriyar Rzayev Posted on July 30, 2015 Categories Misc Topics Tags ERROR 1054 (42S22), ERROR 1054 (42S22): Unknown column '' in 'field list' 2 Comments on Unknown column ‘smth’ in ‘field list’ -> Oldie but goodie error

Sometimes, when you implement wrong trigger, it happens. So just drop your trigger by using:

DROP TRIGGER [IF EXISTS] [schema_name.]trigger_name

and it actually worked in my Mysql case. Maybe helpful for some of you.

mysql - ERROR 1054 (42S22): Unknown column , ERROR 1054 (42S22): Unknown column 'Firstname' in 'field list'. I'M gettin the above error when I enter: mysql> insert into people (fname, lname) -> VALUES� select employee.employee-name, employee.street, employee.city from employee, works where employee.employee-name=works.employee-name and company-name = 'First Bank Corporation' and salary > 10000; ERROR 1054 (42S22): Unknown column 'employee.employee' in 'field list'

Column marks is defined as not nullable with default value NULL. I suppose that is the problem. You should assign a value in the insert or change default value

MySQL Bugs: #68715: ERROR 1054 (42S22): Unknown column, Bug #68715, ERROR 1054 (42S22): Unknown column. Submitted: 19 Mar 2013 9:33, Modified: 25 Mar 2013 11:28. Reporter: rajnish kumar, Email Updates:. Description: HI team, yesterday i create a table below are desc for it . desc t1 ; +-----+-----+-----+-----+-----+-----+ | Field | Type | Null | Key | Default | Extra

The table you are reference in the query does not have a column named marks. First check that you have to correct query which failed and not looking at a different query. Specially when the error message say the table doesn't have a marks column and your query doesn't even have this column written then you are looking at the wrong query. Then check the table you are using and that it has a column named marks. Your error message has nothing to do about NULL or NOT NULL.

INSERT INTO ERROR 1054 (42S22): Unknown column , ERROR 1054 (42S22): Unknown column 'Anderson' in 'field list' *** mate? Single quote or ` backtick? Please elaborate on this.. I thought it was� Let’s see when the #1054 error occurs in MySQL. While inserting a varchar value, if you will forget to add single quotes, then this error will arise.

I found a similar problem with the command:

INSERT INTO `rel_artsizeprice` (`art_id`, `artsize_id`, `price_tax`) VALUES (1, 3, 2.5);
ERROR 1054 (42S22): Unknown column ' 2.5' in 'field list'

If I delete the space before 2.5, it works:

INSERT INTO `rel_artsizeprice` (`art_id`, `artsize_id`, `price_tax`) VALUES (1, 3,2.5);
Query OK, 1 row affected (0.06 sec)

I a large list of such insert values there are only some places, which generates an error. So I think, that there is an error in the source of the commandline tool (readline or mysql).

I used:

mysql --version
mysql  Ver 15.1 Distrib 10.0.26-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

Why the #1054, Following is the error − mysql> insert into DemoTable798 values(100,Adam); ERROR 1054 (42S22): Unknown column 'Adam' in 'field list'. ERROR 1054 (42S22): Unknown column ‘password’ in ‘field list’ This means , there is no column named “password” inside the user table. After a quick google search, I found that In MySQL 5.7, the password field in mysql.user table field was removed, now the field name is ‘authentication_string’ .

MySQL ERROR 1054 (42S22): Unknown column 'Password' in 'field , MySQL ERROR 1054 (42S22): Unknown column 'Password' in 'field list' – Version 5.7. Posted by FatDBA on November 27, 2017. mysql> update mysql. user set� 1054 Unknown column 'nome da coluna' in local/clásula. Esse erro ocorre geralmente quando a coluna não existe, foi digitada errada, faltou aspas em um valor que acabou sendo interpretado como uma coluna ou no pior caso a tabela acabou-se corrompendo.

ERROR 1054 (42S22): Unknown column 'plugin' in 'mysql.user , Your problem has to do with mysql.user and the way you upgraded to MySQL 5.6 . If you look my answer to Cannot GRANT privileges as root, I show you the�

ERROR 1054 (42S22): Unknown column ” in 'field list' – Azerbaijan , Error is -> ERROR 1054 (42S22): Unknown column 'c2' in 'field list' The Place where you can encounter this error is something similar below:

Comments
  • that is strange. I for one always supply column names except for auto_inc ones, and I NEVER use default values. but that is me
  • I would expect that message to be caused by a query which has marks in its select. Are you sure the query you posted causes the error?
  • yeah @Drew, I know but I was never using the column. Didn't realize it was there till I suddenly started getting this error.
  • Then what happens when you DO use the marks column?
  • @FuzzyTree it occurs here regardless whether marks is in select or not
  • yes you are right.They are NOT NULL but providing all values doesn't help. Still get same error.
  • I didnt get the error. See near the bottom of my A block ... right above -- 1 row(s) affected
  • Have you removed not nullable constraint or added a value for marks column?