Subject | Re: The Last Record.......in Selects |
---|---|
Author | henry FRANQUET |
Post date | 2003-05-17T13:10:55Z |
--- In ib-support@yahoogroups.com, "Fernando Buitrago \(Listas y
Foros\)" <buitragon@h...> wrote:
ORDER BY DATE_OF_CHANGE DESC,
TIME_OF_CHANGE DESC
so the last record become the first and exit
INTO :P_PRICE;
EXIT;
END
Foros\)" <buitragon@h...> wrote:
> Hifirst change the order by clause to
>
> If I try to capture the last record, what is missing?
>
> CREATE PROCEDURE SP_PRODUCT_PRECE (
> P_ESTATION INTEGER,
> P_PRODUCT CHAR (4))
> RETURNS (
> P_PRICE FLOAT)
> AS
> BEGIN
> SELECT PRECIO_COMPRA
> FROM PRODUCTS_PRICES
> WHERE ID_ESTACION = :P_ESTACION AND
> ID_PRODUCT = :P_PRODUCT
> ORDER BY DATE_OF_CHANGE,
> TIME_OF_CHANGE
> INTO :P_PRICE
> END
>
> This Select returns multiple records, But I want just the last.
>
> Regards
>
> Fernando Buitrago
>
ORDER BY DATE_OF_CHANGE DESC,
TIME_OF_CHANGE DESC
so the last record become the first and exit
INTO :P_PRICE;
EXIT;
END