Subject Re: [firebird-support] select first & union
Author Helen Borrie
At 06:51 PM 23/08/2007, you wrote:
>if I have
>select first 25 skip 25 id from ......
>select count(*) from ....
>order by 1
>what should the order by apply to, I want it to apply to the first
>select so the first/skip is correct but syntax does not allow an order
>by until the end due to the union.


>Should I be approaching this differently.

One is forced to ask, approaching *what* differently? You want a
list of up to 26 numbers, of which the first 25 are table id's and
the 26th is a count of something with nothing to differentiate it
from the 25 id's except that it will be (a) last or (b) missing (if
there is an id with the same number as the count). What's the objective?