select round(long_w,4)
from station
where lat_n < 137.2345
order by lat_n desc
limit 1;
此查询提供
- 第1行出现错误:ORA-00933:SQL命令未正确结束
解决此错误
答案 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;