MySQL error 1054
ERROR 1054 (42S22): Unknown column in 'field list'
The query names a column the server can’t find in the tables it’s reading. Often the column really is missing or misspelt; as often, it’s a string written without quotes, or a SELECT alias used in WHERE.
ERROR 1054 (42S22): Unknown column 'emial' in 'field list'
Tested on MySQL 8.4.11 and MariaDB 11.4.13 · Updated 9 October 2026
What it means
The server parsed your statement, then looked for each column it names in the tables the statement reads, and one wasn’t there. The message says which name it couldn’t find and in which part of the statement:
| MySQL says | MariaDB 11.4 says | Where |
|---|---|---|
'field list' | 'SELECT', 'SET', 'INSERT INTO' | The select list, an UPDATE … SET, an INSERT column list |
'where clause' | 'WHERE' | WHERE |
'on clause' | 'ON' | A join condition |
'order clause' | 'ORDER BY' | ORDER BY |
'group statement' | 'GROUP BY' | GROUP BY |
The name in quotes is what the server read, which isn’t always what you meant to be a column.
Common causes
- The column doesn’t exist: a typo, or a migration that added it hasn’t run on this database.
- A string without quotes.
WHERE name = Johnasks for a column calledJohn. - Double quotes with
ANSI_QUOTESon. In that SQL mode"Ann"is a column name, not a string. Without it,"name"is a string, soWHERE "name" = 'Ann'raises no error and quietly matches nothing. - A
SELECTalias used inWHERE.WHEREruns before the select list, sototalfromprice * qty AS totaldoesn’t exist there yet. - Mixing comma joins and
JOIN.FROM a, b JOIN c ON c.x = a.idfails, becauseJOINbinds tighter than the comma, soaisn’t in scope for thatON. - A stray space or wrong backticks:
`name `is a different column fromname.
How to fix it
Check the table’s columns
SHOW COLUMNS FROM customers;
Or search a whole database, when you’re not sure which table has it:
SELECT table_name, column_name
FROM information_schema.columns
WHERE table_schema = DATABASE() AND column_name LIKE '%mail%';
Column names aren’t case-sensitive in MySQL or MariaDB, so a case difference alone never causes 1054. If the column belongs to a pending migration, run it; see adding a column for how that locks the table.
Quote strings with single quotes
SELECT id FROM customers WHERE name = 'John';
Single quotes are always strings. Backticks are always names. Avoid double quotes for either, since
their meaning depends on ANSI_QUOTES.
Don’t use a select alias in WHERE
Repeat the expression, or wrap the query so the alias exists:
SELECT id, price * qty AS total FROM invoices WHERE price * qty > 100;
SELECT * FROM (SELECT id, price * qty AS total FROM invoices) t WHERE total > 100;
HAVING total > 100 also works in MySQL and MariaDB, but it filters after grouping, which reads
less clearly when there’s no GROUP BY.
Write every join as a JOIN
SELECT c.name
FROM customers c
CROSS JOIN invoices i
JOIN customers c2 ON c2.id = c.id;
Replacing the comma with CROSS JOIN (or wrapping the comma list in brackets) puts c back in
scope for the ON.
Reproduce it
On MySQL 8.4.11, with customers (id, name, email) and invoices (id, customer_id, price, qty):
SELECT emial FROM customers;
SELECT id FROM customers WHERE name = John;
SELECT id, price * qty AS total FROM invoices WHERE total > 100;
SELECT c.name FROM customers c, invoices i JOIN customers c2 ON c2.id = c.id;
SELECT id FROM customers ORDER BY created_at;
SELECT name, COUNT(*) FROM customers GROUP BY nmae;
ERROR 1054 (42S22): Unknown column 'emial' in 'field list'
ERROR 1054 (42S22): Unknown column 'John' in 'where clause'
ERROR 1054 (42S22): Unknown column 'total' in 'where clause'
ERROR 1054 (42S22): Unknown column 'c.id' in 'on clause'
ERROR 1054 (42S22): Unknown column 'created_at' in 'order clause'
ERROR 1054 (42S22): Unknown column 'nmae' in 'group statement'
MariaDB 11.4.13, same statements:
ERROR 1054 (42S22): Unknown column 'emial' in 'SELECT'
ERROR 1054 (42S22): Unknown column 'John' in 'WHERE'
ERROR 1054 (42S22): Unknown column 'total' in 'WHERE'
ERROR 1054 (42S22): Unknown column 'c.id' in 'ON'
ERROR 1054 (42S22): Unknown column 'created_at' in 'ORDER BY'
ERROR 1054 (42S22): Unknown column 'nmae' in 'GROUP BY'
With ANSI_QUOTES added to the session’s sql_mode, WHERE name = "Ann" failed on both with
Unknown column 'Ann'; without it, WHERE "name" = 'Ann' ran and returned no rows.
In Inlet
The query editor completes column names from the live schema, so typos are less likely to reach the server. When a query fails, Inlet shows the error with a hint; with your own Anthropic API key, Ask Claude (⌘L) can fix the failed statement, sending the schema and the SQL but never your rows.