Re: Select a specified number items from a table
Posted in 1996
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
-----------------------------------------------------------------------------