Skip to content
Advertisement

ERROR 1054 (42S22): Unknown column ” in ‘where clause’

The MySQL query got following error.

ERROR 1054 (42S22): Unknown column ‘scope.full_name’ in ‘where clause’

Here are two tables as below.

1.scope:

2.file:

Query command is:

I understand backticks in MySQL means ” allow spaces and other special characters (except for backticks, obviously) in table/column names”, but even the following command causes same error.

For more information, MySQL server version is 5.7.20 on Linux system.

Advertisement

Answer

You need to join the tables like this:

The line JOIN scope s on s.file = f.id joins the table data using the column file from the scope table and the handle_id column from the file table.

I have linked this website many times for questions like this – it’s a great visual explanation of joins.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement