// 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
Error message
invalid relational operator

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: write IS NULL, not = NULL, and not NULL alone.

How to fix it

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

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.