Can you name a single popular database that doesn't support LIMIT statement?

好久不见. 提交于 2020-05-15 07:56:07

问题


Drupal uses db_query_range() for the reason that not all databases support LIMIT,

can you name a few?


回答1:


DB2, MSSQL, Oracle, and Informix all do not support LIMIT. As a matter of fact, it's not in the SQL standard. (The standard one is "FETCH FIRST" indeed)

Here is a good source for SQL comparisons: http://troels.arvin.dk/db/rdbms/#select-limit




回答2:


Microsoft SQL Server does not support LIMIT. It supports the TOP statement which can be used to accomplish similar things. The primary limitation with TOP is the inability to specify an offset.




回答3:


ms sql, oracle.

and actually LIMIT doesn't exists in ANSI SQL '92 which all modern databases should follow. so currently it's just an unnecessary extension/syntactic sugar/specific sql dialect




回答4:


DB2, Oracle, and MS SQL Server do not support the LIMIT clause.

Google for <database name> LIMIT, and you'll get to know the equivalent supported clause for that database, or whether LIMIT itself is supported.




回答5:


On the flip side, ANSI-92 SQL provides the ROW_NUMBER() window function for achieving this, which is supported on many databases. See SELECT (SQL) on Wikipedia.



来源:https://stackoverflow.com/questions/2832013/can-you-name-a-single-popular-database-that-doesnt-support-limit-statement

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!