# sqlite3.OperationalError: near "x": syntax error

**Code:** `SQLite syntax error` · **Category:** SQL · **Seen on:** SQL

SQLite couldn’t parse the statement; the token after “near” is where it stopped.

## Meaning

Reserved words as identifiers, unsupported syntax from other databases (ALTER COLUMN, RIGHT JOIN in old versions), or placeholders in the wrong place.

## Common causes

- Reserved word as a column name (order, group)
- MySQL/PostgreSQL-only syntax
- Parameter placeholders for table/column names

## Quick fix

1. Quote identifiers with double quotes
2. Check SQLite’s supported syntax for your version
3. Only parameterize values, not identifiers

## Detailed fix by platform

### SQL

1. `SELECT "order", total FROM sales;`

## How to diagnose

1. **Token** — Which one after "near"?
2. **Version** — sqlite3 --version

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/sql/sqlite-near-syntax-error)
