开发者

Oracle syntax error [duplicate]

This question already has answers here: How do I limit the number of rows returned by an Oracle query after ordering? (14 answers) 开发者_Go百科 Closed 3 years ago.

I got the following error in Oracle:

SELECT * FROM abcd WHERE name LIKE 'a%' LIMIT 10
                                        *
ERROR at line 1:
ORA-00933: SQL command not properly ended

What is the problem with the command?


Oracle doesn't support the limit clause. That's a MySQL/Postgres thing.

There are alternatives, although they're often a lot more involved

http://www.oracle.com/technology/oramag/oracle/06-sep/o56asktom.html

The simplest equivalent is:

select * from abcd where name like 'a%' and ROWNUM <= 10;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜