Re: Group by & Distinct

From: Daniel Wyler <dwyler_at_johnbryce.co.il>
Date: 1996/06/02
Message-ID: <31B20303.453F_at_johnbryce.co.il>#1/1


raj Agarwal wrote:
>
> In a query that has a 'group by' , will a 'distinct' give any different
> result?
>
> As a group by will group all same values into one row, I think the
> distinct will not change the result set.
>
> Is this correct? If not correct would appreciate a sample query and
> data sample where the above is not true.
>
> Thanks,
>
> raj

I don't agree with you. The distinct is for the selection (if there are 5 rows of customer #1 he will only get one row with a distinct) , the group by is about the result (if you ask for an avg(sales) on customer #1 you get the average of each of the 5 rows).

Regards

Daniel Wyler Received on Sun Jun 02 1996 - 00:00:00 CEST

Original text of this message