Toad World® Forums

ORA-00913: too many values 00913. 00000 - "too many values"


#1

Hello everyone.
I have this error:
ORA-00913: too many values
00913. 00000 - “too many values”


SELECT e.LAST_NAME AS"EMPLEADO",
e.SALARY AS"SALARIO MENSUAL"
, ( select * from hr.employees t1 where not exists ( select * from HR.DEPARTMENTS t2 where t1.department_id = t2.department_id ) )
FROM HR.EMPLOYEES e
inner join hr.departments d
on d.DEPARTMENT_ID IN(20,50) AND e.SALARY BETWEEN 5000 AND 12000;

Obviously the following query works.
SELECT e.LAST_NAME AS"EMPLEADO",
e.SALARY AS"SALARIO MENSUAL"
FROM HR.EMPLOYEES e
inner join hr.departments d
on d.DEPARTMENT_ID IN(20,50) AND e.SALARY BETWEEN 5000 AND 12000;

But I need the column
( select * from hr.employees t1 where not exists ( select * from HR.DEPARTMENTS t2 where t1.department_id = t2.department_id ) )

Thank you for your feedback