ORA-00933 🗃️ SQL

ORA-00933: SQL command not properly ended

Oracle found extra clauses or syntax it doesn’t support at the end of a statement.

Seen on: SQL

Meaning

Classic causes: LIMIT (use FETCH FIRST), AS before table aliases, a trailing semicolon sent through JDBC/drivers, or JOIN syntax errors.

Common causes

  • LIMIT clause (MySQL syntax)
  • AS keyword for table aliases
  • Trailing semicolon in driver SQL
  • ORDER BY in subqueries/inserts

⚡ Quick fix

  1. Use FETCH FIRST n ROWS ONLY (12c+)
  2. Remove AS from table aliases
  3. Strip trailing semicolons in application SQL

Detailed fix by platform

SQL

  1. SELECT * FROM orders o ORDER BY created_at DESC FETCH FIRST 10 ROWS ONLY;

How to diagnose

  1. Statement — What follows the main clause?
  2. Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.