Subject Re: [firebird-support] Select records by their position
Author Magno Machado
>
> First 2, skip 1 or so? And then First 4 skip 3.

Both in the same query, is it possible? Or I have to execute two queries?

I know I can do it using N queries with first/skip, but I was looking for a
way to do it using one query only.

2007/8/17, Martijn Tonies <m.tonies@...>:
>
> Hi,
>
> > > There is no "position" in a table, there's only a "position" in a
> > > resultset
> > > that's
> > > ordered.
> >
> > Ok. So i'll rewrite my question:
> > Is it possible to select some records from a resultset based on their
> > positions?
> > I think it's the same idea used by the first/skip clauses. Am I wrong?
> >
> > > > f.e.:
> > > > F.e., if I want only the 1st, 2nd, 80th and 100th record from a
> table.
> > > > I know the first/skip clauses, but they don't solve my
> problem(AFAIK)
> > >
> > > Why not?
> >
> >
> > Hum..
> > I thought it work with a range only... F.e., if I want the 2nd, 3rd and
> 4th
> > rows I can use "select first 3 skip 1 .............."
> > But if I want the 2nd and 4th only?
>
> Then select 2nd and 4th only.
>
> First 2, skip 1 or so? And then First 4 skip 3.
>
> It's a rather strange requirement though ;-)
>
> Martijn Tonies
> Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle
> &
> MS SQL Server
> Upscene Productions
> http://www.upscene.com
> My thoughts:
> http://blog.upscene.com/martijn/
> Database development questions? Check the forum!
> http://www.databasedevelopmentforum.com
>
>
>


[Non-text portions of this message have been removed]