Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

sql

mysql

mariadb

I get this annoying error when I try to insert data from db1 to db2 in MaridaDB 10 using mysql CLI. This is while all the columns exist.

INSERT INTO db2.thread (threadid, title, postuserid, dateline, views)
SELECT  `nid`, `title`, `uid`, ‍‍`created`,
`comment`   from db1.node  where type = 'forum'  and status = 1;

When I execute the same query in PHPMyAdmin, I get:

#1054 - Unknown column 'â€

I tried different syntax like 'like' etc. with no avail. Appreciate your hints

like image 774
qliq Avatar asked Jun 04 '13 05:06

qliq


People also ask

How do I fix MySQL Unknown column in field list error?

To fix the error above, simply add a quotation mark around the value. You can use both single quotes or double quotes as shown below: INSERT INTO users(username, display_name) VALUES ("jackolantern", 'Jack'); Now the INSERT statement should run without any error.

Why is there an unknown column in the field list?

The MySQL unknown column in field list error happens when you put a column name in your SQL script that can't be found by MySQL. The error above is because there's no student_name column in the students table.


1 Answers

Looks like there are invisible garbage characters in your query.

Try retyping the query (don't copy and paste or you'll most likely include the garbage character) and it should work.

like image 153
Joachim Isaksson Avatar answered Oct 05 '22 19:10

Joachim Isaksson