1064
Syntax Error
You have an error in your SQL syntax. This is the most common MySQL error, typically caused by typos, missing keywords, or incorrect clause ordering.
Solution
Check for typos near the position indicated in the error message. Verify keyword order (SELECT...FROM...WHERE...GROUP BY...ORDER BY). Use the SQL AI Fixer tool to automatically detect and fix syntax issues.
1146
Table Doesn't Exist
The specified table does not exist in the database. This can occur due to a misspelled table name or referencing a table in the wrong database.
Solution
Verify the table name with SHOW TABLES. Check that you're connected to the correct database. Table names are case-sensitive on Linux systems.
1054
Unknown Column
The specified column was not found in the table. Often caused by misspelling a column name or referencing a column from the wrong table in a join.
Solution
Use DESCRIBE table_name to view available columns. When using joins, qualify column names with table aliases (e.g., u.name).
1062
Duplicate Entry
An INSERT or UPDATE statement would result in a duplicate value for a UNIQUE index or PRIMARY KEY constraint.
Solution
Check existing data for duplicates before inserting. Use INSERT ... ON DUPLICATE KEY UPDATE or INSERT IGNORE when appropriate.
1451
Foreign Key Constraint Failure
Cannot delete or update a parent row because a foreign key constraint fails. A child table has rows that reference this record.
Solution
Delete or update the child rows first, or use ON DELETE CASCADE in your foreign key definition. Check dependencies with SHOW CREATE TABLE.
42601
Syntax Error
A syntax error was found in the SQL statement. PostgreSQL provides detailed position indicators showing exactly where the error occurred.
Solution
Check the character position indicated in the error. Common causes include missing commas, unmatched parentheses, and using MySQL-specific syntax (e.g., backticks instead of double quotes for identifiers).
42P01
Undefined Table
The referenced table (relation) does not exist in the current schema. PostgreSQL uses schemas, so the table may exist in a different schema.
Solution
Check available tables with \dt in psql. Try qualifying with schema: public.table_name. Verify your search_path setting.
42703
Undefined Column
The referenced column does not exist in the table. In PostgreSQL, unquoted identifiers are folded to lowercase, which can cause issues with mixed-case column names.
Solution
Use \d table_name to list columns. If the column was created with mixed case, use double quotes: "columnName".
23505
Unique Violation
An INSERT or UPDATE violates a unique constraint. The duplicate key value is shown in the error detail.
Solution
Use INSERT ... ON CONFLICT DO UPDATE (upsert) or ON CONFLICT DO NOTHING. Check existing data before inserting.
ORA-00942
Table or View Does Not Exist
The specified table or view does not exist, or you do not have the necessary privileges to access it.
Solution
Verify the table exists with SELECT * FROM ALL_TABLES WHERE TABLE_NAME = 'YOUR_TABLE'. Check that you have SELECT privilege. Prefix with schema if needed: SCHEMA.TABLE_NAME.
ORA-00904
Invalid Identifier
A column name or alias is invalid. This usually means the column does not exist or is misspelled.
Solution
Check column names with DESC table_name. Oracle converts unquoted identifiers to uppercase. If you used lowercase when creating, quote it: "column_name".
ORA-00936
Missing Expression
An expression is expected but was not found. Common causes include an empty SELECT list, trailing commas, or incomplete WHERE clauses.
Solution
Check for trailing commas in your SELECT list. Ensure all clauses have complete expressions. Verify no keywords are used as unquoted identifiers.
ORA-00933
SQL Command Not Properly Ended
The SQL statement has extra or incorrect text at the end. Oracle does not support LIMIT; use ROWNUM or FETCH FIRST instead.
Solution
Remove LIMIT clause and use FETCH FIRST n ROWS ONLY (12c+) or WHERE ROWNUM <= n. Check for MySQL/PostgreSQL-specific syntax that Oracle doesn't support.
Msg 102
Incorrect Syntax
There is a syntax error near a specific token. SQL Server uses T-SQL which has some differences from standard SQL.
Solution
Check the token mentioned in the error. Use square brackets [column] for reserved words. Use TOP instead of LIMIT. Ensure proper T-SQL syntax for stored procedures and CTEs.
Msg 208
Invalid Object Name
The specified table or object does not exist in the current database. This can also occur when the schema prefix is missing.
Solution
Verify you're in the correct database with SELECT DB_NAME(). Use full qualification: dbo.table_name. Check available tables with SELECT * FROM INFORMATION_SCHEMA.TABLES.
Msg 207
Invalid Column Name
The specified column does not exist in the target table. Column aliases defined in SELECT cannot be used in the WHERE clause of the same query.
Solution
Check columns with sp_columns table_name. If using an alias in WHERE, wrap in a subquery or CTE. Use square brackets for column names with spaces or reserved words.
Msg 2627
Unique Key Constraint Violation
An INSERT or UPDATE statement violates a PRIMARY KEY or UNIQUE constraint. The duplicate key value is included in the error message.
Solution
Use MERGE for upsert operations. Check for existing records before inserting. Consider using IF NOT EXISTS patterns for conditional inserts.
No error codes found matching your search.