【问题标题】:Error in creating procedure Oracle SQL创建过程 Oracle SQL 时出错
【发布时间】:2016-11-23 23:22:29
【问题描述】:

我想创建一个程序,删除 salary 最高的 员工。我有这个代码:

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;

但我收到以下错误: 错误 (4,1): PL/SQL: SQL 语句被忽略。 错误(4,16):PL/SQL:Ora-00942 表或视图不存在。 如何让它发挥作用?

【问题讨论】:

    标签: stored-procedures oracle-sqldeveloper


    【解决方案1】:

    看第 4 行:

    delete from hr.Almalmazott2 where

    您知道要从哪个表中删除吗?这看起来像一个表格列。

    【讨论】:

    • 不,抱歉我忘了翻译。 hr 是一个模式,hr.Employees 是一个表本身。
    • 好的,你能desc fr.Employees吗?
    • 我是。我看到了姓名、薪水、工作等等。
    猜你喜欢
    • 1970-01-01
    • 2021-06-16
    • 1970-01-01
    • 2018-12-21
    • 1970-01-01
    • 2013-02-12
    • 1970-01-01
    • 1970-01-01
    • 2020-09-18
    相关资源
    最近更新 更多