开发者

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

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

can 开发者_开发百科you name a few?


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


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.


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


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.


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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜