0

I want to create a procedure that deletes the employee with the greatest salary. I have this code:

create or replace procedure DelMostExpensive
as
begin
delete from hr.Employees where 
hr.Employees.EmpName=
(select EmpName from hr.Employees where 
salary = (select max(salary) from hr.Employees))
and hr.Employees.birthDate=
(select birthDate from hr.Employees where 
salary = (select max(salary) from hr.Employees));
end;

But I get these errors: Error(4,1): PL/SQL: SQL statement ignored. Error(4,16): PL/SQL: Ora-00942 table or view does not exist. How to make it work?

1 Answer 1

1

Look at line 4:

delete from hr.Almalmazott2 where

Do you know what table you're trying to delete from? This looks like a table column.

Sign up to request clarification or add additional context in comments.

3 Comments

nope and sorry I forgot to translate. hr is a schema, hr.Employees is a table itself.
Ok, are you able to desc fr.Employees ?
I am. I see the name, salary, job, whatnots.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.