【问题标题】:get error in select the nth column in oracle [duplicate]在oracle中选择第n列时出错[重复]
【发布时间】:2021-01-10 10:24:51
【问题描述】:

我试图从员工表中选择secondhighestsalary,这是我的尝试,但它返回了

SQL 语句没有正确结束

select salary as secondhighestsalary from employee 
order by salary desc
offset 1 rows
fetch next 1 rows only;

那里有什么问题?甲骨文 SQL。

提前致谢。

【问题讨论】:

  • 试试这个:select salary as secondhighestsalary from employee WHERE rownum BETWEEN 1 and 1; order by salary desc

标签: sql oracle top-n


【解决方案1】:

据我所知,从 Oracle 12 c 开始支持这种结构 Oracle 11g OFFSET FETCH gives error

【讨论】:

    猜你喜欢
    • 2020-07-27
    • 1970-01-01
    • 2018-08-17
    • 1970-01-01
    • 1970-01-01
    • 2015-08-06
    • 2021-10-15
    • 2013-07-29
    • 2016-11-03
    相关资源
    最近更新 更多