Hi Octavian The reason your query with the where clause of rownum<=20 and rownum>=10 returns no rows is as folllows. The value for ROWNUM is assigned by Oracle as follows (taken directly from the section entitled 'ROWNUM Pseudocolumn' in the SQL Reference manual): " For each row returned by a query, the ROWNUM pseudocolumn returns a number indicating the order in which Oracle selects the row from a table or set of joined rows. The first row selected has a ROWNUM of 1, the second has 2, and so on." The value of ROWNUM is the number of the row retrieved initially out of the database and does not represent the order in which rows are displayed (although you can force this thru the use of a subquery). So don't count on ROWNUM returning the same row for multiple executions of the same query -- there is no guarantee of this. Further, the manual says the following, which describes why your query returns no rows: "Conditions testing for ROWNUM values greater than a positive integer are always false. For example, this query returns no rows: SELECT * FROM employees WHERE ROWNUM > 1; The first row fetched is assigned a ROWNUM of 1 and makes the condition false. The second row to be fetched is now the first row and is also assigned a ROWNUM of 1 and makes the condition false. All rows subsequently fail to satisfy the condition, so no rows are returned." My question to you is why you need rows between 10 and 20? Why can you not simply select the first 10 rows? Peter Quaiattini BITS OPS - Data Hosting Services Canadian Pacific Railway (403) 319-6579 peter_quaiattini@xxxxxx -----Original Message----- From: =?utf-8?B?T2N0YXZpYW4gUsOixZ9uacWjxIM=?= <orasnita@xxxxxxxxx> Subject: Oracle "limit" Date: Sat, 11 Apr 2009 18:17:22 +0300 Hi, Does anyone know Oracle's syntax for the MySQL's equivalent "limit" clause? I've seen that the following SQL query works: select column_name from schema_name.table_name where rownum<=20; But it doesn't return anything if I use: select column_name from schema_name.table_name where rownum<=20 and rownum>=10; ...or other combinations. And I want to select from the row 10 to the row 20. Thanks. Octavian __________ View the list's information and change your settings at //www.freelists.org/list/programmingblind