Re: Select a specified number items from a table
Posted in 1996
Pierre Roussel — — source: Informix-list mailing list archive (1991-1998)
Charley Chen <cchen@transre.com> wrote: >Hi, >I'm having a problem trying to select only a certain number of rows from >a table. For example I want select the 5 most recent currency exchange >rates for the canadian dollar. If anyone have any suggestion or need >further information please email me. Thank you very much. >Charley >Email: cchen@transre.com Using 4GL or esql/c. I would select all data into a cursor sorted (descending) by date/time or some key representing the time sequence of record creation. Then initialize an index counter, do a FOREACH on the cursor and store the data from the first five records read into an array[5]. Hope it helps