Subject Re: [ib-support] FIRST must be before DISTINCT
Author Nando Dessena
Martijn,

> > SELECT FIRST (5) DISTINCT ....
> > returns rows according to primary key
>
> I think the same applies here. Just did a test and got the records in no
> particular order - the plan says it's not ordering. Are you sure this is
> what happens at your place? With my test query, there's no sort order
> mentioned in the plan - and no indices either.

if the DISTINCT's argument has an index, it is used and you get an
ordered result set.
I still won't be sorting, but the rows will be in order.
At least that's what I recall.
Ciao
--
____
_/\/ando