Subject Re: [firebird-support] Select first 3 and last 3 records
Author Ann W. Harrison
Cao Ancoinc wrote:
>
> I need to select the first 3 and last 3 records from a transaction file
> This I would imagine would be a simple query as the example below however
> Firebird objects to the "order by" clause when a "union" operator is present

Firebird objects because the SQL standard is quite clear that the order
by clause can not be used in a select expression in a UNION. Order by
controls the order of results, not the order of inputs. Since what you
want is non-standard, I'd suggest a non-standard solutions - a stored
procedure.


Regards,


Ann