此错误是什么意思以及如何解决

时间:2019-09-26 15:27:04

标签: sql oracle

select round(long_w,4) 
  from station  
 where lat_n < 137.2345 
 order by lat_n desc 
 limit 1;

此查询提供

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

解决此错误

1 个答案:

答案 0 :(得分: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;
相关问题