specific records

2003-07-02 Thread Maciej Bobrowski


Hi,

Let's say I have 1000 records in a 'table'. I want to select rows from 6
to 11. How can I do this?


Regards,
Maciej Bobrowski

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



Re: specific records

2003-07-02 Thread Nils Valentin
SELECT * FROM tablename where column5 AND column12;


Best regards

Nils Valentin
Tokyo/Japan


2003 7 2  18:26Maciej Bobrowski :
 Hi,

 Let's say I have 1000 records in a 'table'. I want to select rows from 6
 to 11. How can I do this?


 Regards,
 Maciej Bobrowski

-- 
---
Valentin Nils
Internet Technology

 E-Mail: [EMAIL PROTECTED]
 URL: http://www.knowd.co.jp
 Personal URL: http://www.knowd.co.jp/staff/nils


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



Re: specific records

2003-07-02 Thread Maciej Bobrowski

 Let's say I have 1000 records in a 'table'. I want to select rows from 6
 to 11. How can I do this?

 SELECT * FROM tablename where column5 AND column12;

No, no. I have no numerical fileds in the table. Your example is not good.
Even if I could add the 'id' column to the table, then when I will remove
some records from the middle part o the table I will have holes, and
the next select will give me wrong data.

Regards,
Maciej Bobrowski

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



Re: specific records

2003-07-02 Thread Dominicus Donny
SELECT * FROM tablename LIMIT 5, 6

Me fail English? That's unpossible
###___Archon___###

- Original Message -
From: Nils Valentin [EMAIL PROTECTED]
To: Maciej Bobrowski [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, July 02, 2003 4:47 PM
Subject: Re: specific records


SELECT * FROM tablename where column5 AND column12;


Best regards

Nils Valentin
Tokyo/Japan


2003 7 2  18:26Maciej Bobrowski :
 Hi,

 Let's say I have 1000 records in a 'table'. I want to select rows from 6
 to 11. How can I do this?


 Regards,
 Maciej Bobrowski

--
---
Valentin Nils
Internet Technology

 E-Mail: [EMAIL PROTECTED]
 URL: http://www.knowd.co.jp
 Personal URL: http://www.knowd.co.jp/staff/nils


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


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



Re: specific records

2003-07-02 Thread Maciej Bobrowski


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 column5 AND column12;

Best regards,

Maciej Bobrowski

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



Re: specific records

2003-07-02 Thread Joseph Bueno
Maciej Bobrowski wrote:
Let's say I have 1000 records in a 'table'. I want to select rows from 6
to 11. How can I do this?


SELECT * FROM tablename where column5 AND column12;


No, no. I have no numerical fileds in the table. Your example is not good.
Even if I could add the 'id' column to the table, then when I will remove
some records from the middle part o the table I will have holes, and
the next select will give me wrong data.
Regards,
Maciej Bobrowski
Maybe:
SELECT * FROM tablename LIMIT 5,5;
See:
http://www.mysql.com/doc/en/SELECT.html
for details
Regards,
Joseph Bueno


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


Re: specific records

2003-07-02 Thread Steve Edberg
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 column5 AND column12;
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]


Re: specific records

2003-07-02 Thread Egor Egorov
Maciej Bobrowski [EMAIL PROTECTED] wrote:
 
 Let's say I have 1000 records in a 'table'. I want to select rows from 6
 to 11. How can I do this?

Use ORDER BY and LIMIT clauses:
http://www.mysql.com/doc/en/SELECT.html



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
   ___/   www.mysql.com




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