![]() |
|
|
#1 |
|
Senior Member
Join Date: Jul 2004
Posts: 167
|
How do you pull every 40th record out of a table?
I'd like to ORDER BY the primary key, so this shouldn't be that intensive of a query and get every 40th "table.title" out of a database. How do I do it?
|
|
|
|
|
|
#2 |
|
Junior Member
Join Date: Jan 2005
Posts: 8
|
Re: How do you pull every 40th record out of a table?
have you tried this
SELECT `id`, `title` FROM `table` WHERE `id` % 40 = 0 ORDER BY `primary key` this will work if you have a auto incremented field for an id |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 1.2.4 How Big MySQL Tables Can Be | Administrator | Documentation | 3 | 10-21-2004 12:38 AM |
| How to Insert data in a table by using the max value from the same table.. | JsS | SQL syntax | 6 | 09-02-2004 04:33 AM |
| 3.3 Creating and Using a Database | Administrator | Documentation | 13 | 06-09-2004 04:56 PM |
| 1.8 MySQL Standards Compliance | Administrator | Documentation | 21 | 06-08-2004 03:18 AM |
| 1.6.4 New Features Planned for the Near Future | Administrator | Documentation | 0 | 06-08-2004 02:47 AM |