Re: How to get single raws for sums in a summary table?

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: nasr(dot)laili(at)tin(dot)it, pgsql-novice(at)postgresql(dot)org
Subject: Re: How to get single raws for sums in a summary table?
Date: 2006-11-22 23:30:25
Message-ID: 358606.46780.qm@web31807.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


> -----------------------------------
>
> PS: I didn't go through all pg-documentation so my guess might be a bit
> of hazard: shouldn't the 'distinct on (some_field)' do all the job on its own
> with no need for the second (sub)select? Otherwise there seems to be no
> difference between 'select distinct on (fx) f1, f2, .,fx,. ,fn' and
> 'select distinct f1, f2, .,fx,. fn'.
>

I think that distinct on works like a where clause. So if filter out records rather than grouping
them. So you end up with a sum of 1 record.

Regards,

Richard Broersma jr.

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Ennio-Sr 2006-11-22 23:41:23 Re: How to get single raws for sums in a summary table?
Previous Message Ennio-Sr 2006-11-22 23:23:54 Re: How to get single raws for sums in a summary table?