ORA-01427: single-row subquery returns more than one row
Definition:
ORA-01427 is an Oracle Database Error Message which stands for:
ORA-01427: single-row subquery returns more than one row
According to the Official Documentation:
Cause: The outer query must use one of the keywords ANY, ALL, IN, or NOT IN to specify values to compare because the subquery returned more than one row.
Action: Use ANY, ALL, IN, or NOT IN to specify which values to compare or reword the query so only one row is retrieved.
In other words, the comparison to the subquery is expecting to compare to a single value, but the subquery is returning more than one value.
This can be solved by changing the the equals operator to ANY
, ALL
, IN
, or NOT IN
.