I'm new to SQL and I'm stuck with a query.
I have 3 tables employees, departments and salary_paid. I'm trying to update bonus column in salary_paid table by giving this condition
give 10% bonus on total salary to the employees who are not in IT departments.
I came up with this query
update salary_paid
set bonus=(select (0.1*total_salary) "Bonus"
from salary_paid, departments, employees
where
employees.department_id=departments.department_id and
employees.employee_id=salary_paid.employee_id and
departments.department_name!='IT')
;
However it returns this error
ORA-01427: single-row subquery returns more than one row
I'm completely clueless on this, please help. Thanks in advance