I have the following query that returns an error and i want to know what is the problem ?
SELECT last_name, first_name FROM employees WHERE salary = (SELECT salary FROM employees WHERE department_id = 30);
the error returned is :
(SELECT salary FROM employees WHERE department_id = 30) * ERROR at line 4: ORA-01427: single-row subquery returns more than one row
hopefully somebody can help.
Thanks in advance.
Hello Garcia,
The message of the ORA error is so descriptive it’s pointing the query that causing the issue and the issue it self which is nothing but the sub query returned more than one row and this is not correct specially that you are using “=” operator not logical operator like “IN” or “NOT IN”. It’s up to your requirement.