Oracle 语法错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2354616/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Oracle syntax error
提问by murali
I got the following error in Oracle:
我在 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?
命令有什么问题?
回答by skaffman
Oracle doesn't support the limit
clause. That's a MySQL/Postgres thing.
Oracle 不支持该limit
子句。那是 MySQL/Postgres 的事情。
There are alternatives, although they're often a lot more involved
有替代方案,尽管它们通常涉及更多
http://www.oracle.com/technology/oramag/oracle/06-sep/o56asktom.html
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;