我在 Oracle 中收到以下错误:
SELECT * FROM abcd WHERE name LIKE 'a%' LIMIT 10
*
ERROR at line 1:
ORA-00933: SQL command not properly ended
命令有什么问题?
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;