| List: | General Discussion | « Previous MessageNext Message » | |
| From: | SpamSucks86 | Date: | December 22 2002 1:56pm |
| Subject: | RE: Return every Nth row in a result set | ||
| View as plain text | |||
I really don't want to do this client side (I'd have to execute approximately 10 queries for every page load just for this small task). Selecting the entire table into a temp table to number the rows also seems rather inefficient. I was reading in a book at Barnes and Noble yesterday which said to use a query that looked something like this: SELECT a.id FROM documents as a, documents as b WHERE a.id >= b.id GROUP BY a.id HAVING MOD(a.id,:n); I'm nearly positive that that isn't exactly what it said, but it was something like that. If anyone can come up with a way to do this without a temporary table and only one or two queries (using 3.x or 4.0) that'd be great. Thanks for the help guys. -Greg
| Thread | ||
|---|---|---|
| • Return every Nth row in a result set | SpamSucks86 | 22 Dec |
| • RE: Return every Nth row in a result set | JamesD | 22 Dec |
| • 4.1 questions: subqueries which use dual | ric | 22 Dec |
| • re: 4.1 questions: subqueries which use dual | Victoria Reznichenko | 24 Dec |
| • Re: Return every Nth row in a result set | ric | 22 Dec |
| • RE: Return every Nth row in a result set | SpamSucks86 | 22 Dec |
| • Re: Return every Nth row in a result set | Benjamin Pflugmann | 22 Dec |
| • RE: Return every Nth row in a result set | SpamSucks86 | 22 Dec |
| • Re: Return every Nth row in a result set | Richard Clarke | 22 Dec |
| • Re: Return every Nth row in a result set | ric | 22 Dec |
| • Re: 4.1 questions: subqueries which use dual | Richard Clarke | 24 Dec |
| • Re: 4.1 questions: subqueries which use dual | Dan Nelson | 24 Dec |
| • Re: 4.1 questions: subqueries which use dual | Richard Clarke | 24 Dec |
| • Re: 4.1 questions: subqueries which use dual | Mark Matthews | 24 Dec |
