Subject Re: [IBDI] Firebird 1
Author Ed Malloy
Peter,

No, I don't think I missed that, I don't understand what you mean. What
does it mean for one "Morris" to be first vs another? You have no idea
of which record is first, so why bother??

If you NEED to know this, then shouldn't your qry be more specific?

ed

Peter Morris wrote:
>
> I think the point you are missing is a very small one.
> The ROWNUMBER is relative to the current result set.
>
> Select Surname from MyTable where Surname like '%Morris%' would start with
> RowNumber 0
> Select Surname from MyTable where Surname like '%Smith%' would start with
> RowNumber 0
>
> Select Surname from MyTable would mean that Morris starts at about 1000 and
> Smith at about 1200
>
> See what I mean ? It is just like a RecordCount property would always tell
> you how many items in the result, not in the table !
>
> Pete
> ===
> http://www.HowToDoThings.com
>
> ----- Original Message -----
> From: Ed Malloy <edm@...>
> To: <IBDI@yahoogroups.com>
> Sent: Friday, June 01, 2001 6:30 AM
> Subject: Re: [IBDI] Firebird 1
>
> > Peter,
> >
> > What am I missing?
> >
> > How do we know that the records are stored in a certain order?? AFAIK,
> > there is no guaranty in SQL that records are stored in any particular
> > order; indeed the way I learned, we should NOT trust anything like row
> > order.
> >
> > If I want to access records in the order that they were entered, I just
> > access them via the Primary key -- which, on my tables is practically
> > always a synthetic variable designed to be nothing but a primary key and
> > that is numbered sequentially.
> >
> > If I wanted .. 20 rows from ... somewhere. Once I establish where
> > somewhere is, I can ask for .... BETWEEN :thiskey and :nextkey (where
> > nextkey = thiskey + 19)
> >
> > ed
> >
> > Peter Morris wrote:
> > >
> > > > actually, wouldn't returning a rowid be a better option than first(x)
> or
> > > > whatever, that way the user can include the rowid in the where clause
> and
> > > do
> > > > whatever the hell they want selection wise? select * from blah where
> rowid
> > > > in (1,3,5,7,9)? I'd think this would be a better option than having it
> as
> > > an
> > > > aggregate style function.
> > >
> > > I agree 100%.
> > > TOP etc are very specific, next thing you know you will have PAGE, LAST,
> etc
> > > etc and that is not good.
> > > As long as the ROWID is the Rownumber of the current selection and is
> > > calculated at the end then this would be a brilliant idea.
> > >
> > > Pete
> > > ===
> > > http://www.HowToDoThings.com
> > >
> > > Community email addresses:
> > > Post message: IBDI@yahoogroups.com
> > > Subscribe: IBDI-subscribe@yahoogroups.com
> > > Unsubscribe: IBDI-unsubscribe@yahoogroups.com
> > > List owner: IBDI-owner@yahoogroups.com
> > >
> > > Shortcut URL to this page:
> > > http://www.yahoogroups.com/community/IBDI
> > >
> > > Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
> >
> > Community email addresses:
> > Post message: IBDI@yahoogroups.com
> > Subscribe: IBDI-subscribe@yahoogroups.com
> > Unsubscribe: IBDI-unsubscribe@yahoogroups.com
> > List owner: IBDI-owner@yahoogroups.com
> >
> > Shortcut URL to this page:
> > http://www.yahoogroups.com/community/IBDI
> >
> > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
> >
> >
> >
>
> Community email addresses:
> Post message: IBDI@yahoogroups.com
> Subscribe: IBDI-subscribe@yahoogroups.com
> Unsubscribe: IBDI-unsubscribe@yahoogroups.com
> List owner: IBDI-owner@yahoogroups.com
>
> Shortcut URL to this page:
> http://www.yahoogroups.com/community/IBDI
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/