# ORA-00933: SQL command not properly ended

**Code:** `ORA-00933` · **Category:** SQL · **Seen on:** SQL

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

## 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.

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/sql/ora-00933-sql-command-not-properly-ended)
