Drupal uses db_query_range()
for the reason that not all databases support LIMIT
,
can you name a few?
Drupal uses db_query_range()
for the reason that not all databases support LIMIT
,
can you name a few?
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.
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
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.