Subject Re: [ib-support] SQL
Author Helen Borrie
At 01:06 PM 08-04-02 +1200, you wrote:
>I have a table like
>
>Number Key Value
>1 10 A
>2 12 B
>2 13 C
>3 14 D
>
>I need a sql statement to get Value where Key is max for a given
>number.
>i.e. I pass 2 to query and I want result C

With Firebird:

select first 1 Value, key
from aTable
where Value = 2
order by key desc

cheers,
Helen

All for Open and Open for All
Firebird Open SQL Database · http://firebirdsql.org ·
http://users.tpg.com.au/helebor/
_______________________________________________________