我写了这个SQL查询:
select first_name, salary
from employees
where salary in( select distinct top(10) salary from employees order by salary disc );
Run Code Online (Sandbox Code Playgroud)
当我运行它时,我收到此错误:
SQL错误:ORA-00907:缺少右括号00907. 00000 - "缺少右括号"
什么可能导致错误?
Top-N查询通常在Oracle中以这种方式执行:
select * from (
select first_name, salary
from employees order by salary desc
) where rownum <= 10
Run Code Online (Sandbox Code Playgroud)
这个可以获得十大薪水.
| 归档时间: |
|
| 查看次数: |
32200 次 |
| 最近记录: |