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

<hans@...> wrote in message news:3B9BA9A4.2004@......
> SELECT FIRST (5) ....
> returns rows in some random order,
> is this as designed ?

If you don't supply a sort order, there's no way you can know in what order
the rows are returned.

> 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.


--
Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird
http://www.interbaseworkbench.com

Upscene Productions
http://www.upscene.com

"This is an object-oriented system.
If we change anything, the users object."




> of course
>
> SELECT FIRST (5) .... ORDER BY PRIMARY KEY
> works as expected
>
>
> Hans
> =====================================
>
> raptor wrote:
> >
> > hi,
> > I've just installed the FB1.0beta
> > this works :
> > SELECT FIRST (5) DISTINCT ....
> >
> > this doesn't :
> > SELECT DISTINCT FIRST (5) ...
> >
> > the funny thing is that the first new feature of FB seems to work
:")))...
> > thanx alot ppl,
> > this feature was the SELECT TOP 1 FROM myList
> > =====
> > iVAN
> > raptor@...
> > =====
> >
> >
> > To unsubscribe from this group, send an email to:
> > ib-support-unsubscribe@egroups.com
> >
> >
> >
> > Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
>
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>