PDA

View Full Version : How to suppress exceeding number of records


H303
02-25-03, 17:45
Is there any way how to limit the number of returned records to a certain value? I have a 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.
The function COUNT(*) will not work, since I cannot calculat something like ... select where ... COUNT(*) > (COUNT(*) -25)
Many thanks for every hint!
Hermann

andrewst
02-25-03, 18:05
The answer depends on your DBMS. For Oracle it is:

WHERE ROWNUM <= 25

H303
02-26-03, 02:50
Hi Tony,
many thanks for your fast reply! Sorry I have to use Paradox and Borland C++. ROWNUM does not work with Paradox.
Regards Hermann