Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Suppress exceeding number of records using SQL

Status
Not open for further replies.

H303

Programmer
Feb 26, 2003
5
DE
Is there any way how to limit the number of returned records to a certain value? I have a Paradox table which holds millions of measurement data and timestamps. When I do a select for a certain time range, I may get back thousends of records and I only need to present the first 25 for a preview.

Functions like:
SELECT ... ... WHERE ROWNUM <= 25 (Oracle)
or
SELECT FIRST 10 * (Informix)
did not work with Paradox and BDE.

Many thanks for every hint!
Hermann
 
I've not done this using SQL statements but I have with TTable. Let me know if you want to fo this route. James P. Cottingham

When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity.
[tab][tab]Albert Einstein explaining his Theory of Relativity to a group of journalists.
 
Hi James, thanks for your response.
I do have to use SQL, but anyway it would be very interesting how to solve the problem. When we run into serious problems with this issue then, may be, I woud be very glad to have solution beside SQL.
Regards Hermann
 
copy a thousand or so records to a temp file
and then do your sql. if you dont get enough
do it again. you could implement a random copy
also.

maybe not so elegant but it might get the job
done for now.

tomcruz.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top