// Oracle error reference
ORA-00920: invalid relational operator
A condition in WHERE or HAVING has a missing or invalid comparison operator, such as a lone column or an operator Oracle doesn't support.
- Error code
ORA-00920- Category
- Syntax and SQL statements
What it means
ORA-00920 means a condition is missing its comparison, or uses something Oracle doesn't accept as one. Oracle has no boolean column type before 23ai, so WHERE active is not a valid condition there.
Common causes
- A bare column as a condition:
WHERE is_active. - A typo such as
=>,=<or==. - A missing operator before
NULL: writeIS NULL, not= NULL, and notNULLalone.
How to fix it
-
Compare explicitly.
SELECT * FROM users WHERE is_active = 1; SELECT * FROM users WHERE deleted_at IS NULL;
Related errors
More syntax and sql statements errors
ORA-00907missing right parenthesisORA-00911invalid characterORA-00917missing commaORA-00918column ambiguously definedORA-00923FROM keyword not found where expectedORA-00937not a single-group group functionORA-00979not a GROUP BY expressionORA-01427single-row subquery returns more than one row
The code and message text are from the Oracle Database Error Help. Browse the full Oracle error list or search every database error.
// fewer errors, faster fixes
Work on Oracle in SQLly
A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for Oracle and the other databases you use.