Subject Re: Select question
Author Alexander V.Nevsky
--- In firebird-support@yahoogroups.com, "Rick DeBay" <rdebay@r...> wrote:
> Given a table
>
> name sequence otherColumns...
> A 999
> A 998
> B 999
> B 998
> B 997
> C 999
>
> how can I get back only rows two five and six, plus their associated
> other columns?
> My immediate thought was to use GROUP BY and get the MIN of sequence,
> but of course that wouldn't give me the other columns of that row.

Select T1.*
From ThisTable T1
Where T1.Sequence=
(Select First 1 T2.Sequence
From ThisTable T2
Where T2.Name=T1.Name
Order By T2.Sequence)

Best regards,
Alexander.