Subject | Re: Select question |
---|---|
Author | Alexander V.Nevsky |
Post date | 2004-07-09T19:18:56Z |
--- In firebird-support@yahoogroups.com, "Rick DeBay" <rdebay@r...> wrote:
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.
> Given a tableSelect T1.*
>
> 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.
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.