Subject | Re: Problem with select statement using FIRST |
---|---|
Author | woelyc |
Post date | 2003-09-28T09:40:49Z |
--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@t...>
wrote:
result
select p1.PRT_NAME, p1.PRT_ID,
Case
when p1.prt_used > (Select first 1 skip 10 p2.PRT_USED
from BOM_PART p2
order by p2.PRT_USED desc)
then 1
else 0
end
from BOM_PART p1
order by 3 desc, p1.PRT_NAME
Thanks for the reply,
Andy
wrote:
> At 12:35 PM 27/09/2003 +0000, you wrote:perception...
> >Hi,
> >
> >I'm having a problem with the following select statement.
> >
> >select t1.*
> >from table1 t1
> >where t1.id in (select first 10 t2.id from table1 t2 where t2.id <
> >100)
> >order by t1.name
> >
> >This example will give all the records of the dataset but I only
> >want 10 records of the dataset.
> >
> >Is there a problem with the select statement or is it a bug in
> >Firebird?
>
> Perhaps a combination of scrambled cursors and scrambled
>what you are
> How is the output from this plain-jane query spec different to
> seeking to get:I've searched a but further and following while give the desired
>
> select first 10 * from table1
> where id < 100
> order by name
>
> heLen
result
select p1.PRT_NAME, p1.PRT_ID,
Case
when p1.prt_used > (Select first 1 skip 10 p2.PRT_USED
from BOM_PART p2
order by p2.PRT_USED desc)
then 1
else 0
end
from BOM_PART p1
order by 3 desc, p1.PRT_NAME
Thanks for the reply,
Andy