|
Posted by Sandman on 11/16/05 17:10
In article <1132113150.201641.49730@g44g2000cwa.googlegroups.com>,
"Joshie Surber" <joshiesurber@gmail.com> wrote:
> > have a smart SQL qquery that will fetch it correctly for me in one pass?
>
> If you are fairly sure that the IDs are sequential
Well, had you looked at my example data, you would have seen they are not. :P
> If they aren't sequential, make an educated guess about how
> insequential they are and grab 10 or so on each side and filter out all
> but the five you want in your script. It is a lot faster to grab a lot
> of stuff in one query and filter it in your script than to grab a
> little stuff in two or more queries.
"lots of stuff" could mean tens of thousands of posts, so that's not a good
idea.
what I would like is something like this:
select * from blog where member = 12 and category = 'Sports' and id = 12345
limit -5, 5;
--
Sandman[.net]
Navigation:
[Reply to this message]
|