使用 LIMIT 时 SQL 命令未正确结束 [英] SQL command not properly ended when using LIMIT
本文介绍了使用 LIMIT 时 SQL 命令未正确结束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在 SQL Developer 中执行以下查询.
I am executing the below query in SQL Developer.
SELECT * FROM Person where person_name='rahul' order by created_time desc limit 10;
当我执行它时,SQL Developer 给我以下错误.
When I execute it, SQL Developer gives me below error.
ORA-00933: SQL command not properly ended
00933. 00000 - "SQL command not properly ended"
*Cause:
*Action:
我使用以下链接作为参考.
I used the below link for reference.
https://www.techonthenet.com/sql/select_limit.php
我已经试过了
SELECT * FROM Person where person_name='rahul' order by created_time desc OFFSET 5 ROWS FETCH NEXT 10 ROWS ONLY;
ORA-00933: SQL command not properly ended
00933. 00000 - "SQL command not properly ended"
*Cause:
*Action:
Error at Line: 1 Column: 75
请注意,OFFSET 不被视为关键字.
Note that OFFSET is not treated as keyword.
推荐答案
我已通过使用以下查询解决了该问题.
I have resolved the issue by using the below query.
SELECT * FROM Person where person_name='rahul' and rownum between 1 and 2 order by created_time desc;
这篇关于使用 LIMIT 时 SQL 命令未正确结束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文