Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Billy Wheeler — — source: Informix-list mailing list archive (1991-1998)
At 03:08 PM 3/4/96 GMT, Charley Chen wrote:
>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.
Assuming you're working with 4GL:
DECLARE sel_rates CURSOR FOR
SELECT *
FROM rates
WHERE foreign_currency = "Canadian Dollar"
ORDER BY date_time_stamp DESC
FOR i = 1 TO 5
FETCH sel_rates INTO ar_rates[i].*
END FOR
HTH.
--
Cheers,
Billy.
-----------------------------------------------------------------------------
billy.wheeler@pixie.co.za +27 11 803 2151
p.o. box 3463, rivonia, rsa, 2128 +27 83 250 2324
i'm schizophrenic: my opinions are not those of me
-----------------------------------------------------------------------------
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.