【问题标题】:what does this error means and how to fix it这个错误是什么意思以及如何解决它
【发布时间】:2019-09-26 15:27:04
【问题描述】:
select round(long_w,4) 
  from station  
 where lat_n < 137.2345 
 order by lat_n desc 
 limit 1;

这个查询给出

  • 第 1 行出现错误:ORA-00933:SQL 命令未正确结束

修复这个错误

【问题讨论】:

标签: sql oracle


【解决方案1】:

Oracle 不支持limit,您会收到 Oracle 错误。您可以改为使用:

select round(long_w, 4)
from station
where lat_n < 137.2345
order by lat_n desc 
fetch first 1 row only;

fetch 是在 Oracle 12 中引入的。您也可以使用keep 语法:

select max(round(long_w, 4)) keep (dense_rank first order by lat_n desc)
from station
where lat_n < 137.2345;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-06-25
    • 2010-11-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多