Subject | Re: [ib-support] SQL |
---|---|
Author | Helen Borrie |
Post date | 2002-04-08T03:30:12Z |
At 01:06 PM 08-04-02 +1200, you wrote:
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/
_______________________________________________________
>I have a table likeWith Firebird:
>
>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
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/
_______________________________________________________