【问题标题】:I need to show the subtruction between min and max salary in the Finance Department (for which department_id = 100)我需要显示财务部门的最低工资和最高工资之间的减法(其中department_id = 100)
【发布时间】:2020-04-26 12:02:21
【问题描述】:
SELECT last_name, jobs.(max_salary - min_salary)
FROM employees
JOIN jobs ON employees.job_id = jobs.job_id
where department_id = 100
group by jobs.max_salary;

错误信息:

ORA-01747:无效的 user.table.column、table.column 或列规范
01747. 00000 - “无效的 user.table.column、table.column 或列规范”
*原因:
*行动:
行错误:1 列:24

【问题讨论】:

  • 请提供样本数据和期望的结果。

标签: sql oracle plsql


【解决方案1】:

这个结构:

SELECT last_name, jobs.(max_salary - min_salary)

没有意义。点用于访问表(或视图或类似对象)中的。它不用于表达式。您可以根据列引用构造表达式。

所以,每列引用都需要单独限定:

SELECT last_name, (jobs.max_salary - jobs.min_salary)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-05-01
    • 2021-07-24
    • 2013-05-23
    • 2019-01-25
    • 1970-01-01
    • 1970-01-01
    • 2021-03-08
    • 2016-06-20
    相关资源
    最近更新 更多