Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Select Family, First (Name) from ... group by Family
I would get something that look like what I want, but suppose I add an other
column, Weight
so if I have :
Family Name Weight
--------------- ------------ ----------
Smith John 5'10" Smith Roger 4' 9"
it would give :
Smith Roger 5'10"
but I would prefer to have :
Smith John 5'10"
because what I want is the first record from each group, no matter wich record it is, BUT the values from that record have to come from the same row, you see?
so, if anybody can help, I can't believe Oracle never thought of that ?
thanks
Patrick
Thomas Olszewicki wrote in message ...
>Try this:
>
>Select Family,Max(Name) from People Group By Family.
>Thomas.
>
>
>"Patrick Joyal" <please.reply_at_to.the.newsgroup> wrote in message
>news:38b4438f_at_news...
>>
>> here's an example to understand my problem.
>>
>> I have a table People containing 2 columns : Family and Name
>>
>>
>> Family Name
>> ------------- ------------
>> Smith John
>> Smith Roger
>> Smith Bob
>> Doe Arthur
>> Doe John
>> Souvlaki Angie
>> Souvlaki Benny
>>
>>
>> in Access, if I want 1 member from each family, I use this :
>>
>> Select Family, First (Name)
>> from People
>> Group By Family
>>
>> results :
>>
>> Family Name
>> ------------- -----------
>> Smith John
>> Doe Arthur
>> Souvlaki Angie
>>
>>
>> How could I do this in Oracle ?
>>
>> merci
>>
>> Patrick
>>
>>
>
>
Received on Wed Feb 23 2000 - 15:17:59 CST
![]() |
![]() |