7

我在 Oracle 中收到以下错误:

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

命令有什么问题?

4

1 回答 1

15

Oracle 不支持该limit子句。那是 MySQL/Postgres 的事情。

还有其他选择,尽管它们通常涉及更多

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

最简单的等价物是:

select * from abcd where name like 'a%' and ROWNUM <= 10;
于 2010-03-01T08:47:04.713 回答