Re: sql question
Posted in 1995
Topics: General Discussion
This is a multi-part message in MIME format.
---------------------------------7965463671791602188338621269
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=us-ascii
--
=============================================================================
--- Herve Delmas ---- delmas@ireq.hydro.qc.ca
=============================================================================
---------------------------------7965463671791602188338621269
Content-Transfer-Encoding: 7bit
Content-Type: text/plain
From: Mark.Denham@bbc.co.uk (Mark Denham)
Reply-To: Mark.Denham@bbc.co.uk (Mark Denham)
Newsgroups: comp.databases.informix
Subject: Re: sql question
Date: 13 Oct 1995 03:13:06 -0400
Organization: Mailing List Gateway
Message-ID: <45l3i2$46t@cssun.mathcs.emory.edu>
In article <DGAt5o.F98@ireq.hydro.qc.ca>,
delmas@ireq.hydro.qc.ca (Herve Delmas) wrote:
> How can we made a sql request on a huge table that will get out
>the last lines without using the rowid column?
>
>ex.: let's say that count(*) return 10000 on this table. If we want to get
> the last fifty lines, for now we are doing:
>
> select col1, col2 from table
> where rowid > 9950>
> Any help will be appreciate!
>
>===========================================================================
==
>--- Herve Delmas ---- delmas@ireq.hydro.qc.ca
>===========================================================================
==
Another thought on the subject that you might consider is to use a scroll
cursor for the select.
All you need to do then is OPEN the cursor, FETCH LAST to get last row,
followed by 49 FETCH PREVIOUS calls.....
More reliable way to do it don't you think?
Mark Denham
BBC
London, UK
Mark.Denham@bbc.co.uk
---------------------------------7965463671791602188338621269--