Actually, this will *not* necessarily work. Without an ORDER BY clause, the database is free to return records in any order; after some deletions & insertions, your select below may return different records, in a different order.

I would recommend adding an explicit record number to the table, using an auto_increment column; it may be more work now, but it will be best in the long run.

steve

At 12:02 PM +0200 7/2/03, Maciej Bobrowski wrote:
O.K. I found the way:

select * from tablename limit 5,6;

it will select 6 records counting from 6.

 Let's say I have 1000 records in a 'table'. I want to select rows from6
 to 11. How can I do this?
SELECT * FROM tablename where column>5 AND column<12;

Best regards,


Maciej Bobrowski



--
+------------------------------------------------------------------------+
| Steve Edberg                                      [EMAIL PROTECTED] |
| University of California, Davis                          (530)754-9127 |
| Programming/Database/SysAdmin               http://pgfsun.ucdavis.edu/ |
+------------------------------------------------------------------------+
| [EMAIL PROTECTED]: 1001 Work units on 23 oct 2002                              |
| 3.152 years CPU time, 3.142 years SETI user... and STILL no aliens...  |
+------------------------------------------------------------------------+

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to