Re: Group BY

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: WaGathoni <is(dot)mundu(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Group BY
Date: 2008-10-29 22:01:36
Message-ID: dcc563d10810291501y88a732eq9f8b78e0f4a548a5@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Oct 29, 2008 at 2:59 PM, WaGathoni <is(dot)mundu(at)gmail(dot)com> wrote:
> ....failing with an error to the effect that that that
> coa.doaIhaveChildren and coa.coa_id must be included in the GROUP BY
> clause.... and what is is the recommended course of action.

Generally the solution in postgresql is its proprietary extension of
distinct on ()

select distinct on (field1, field2) field1, field2, field3 from ....

In response to

  • Group BY at 2008-10-29 20:59:44 from WaGathoni

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2008-10-29 22:18:51 Re: Slow query performance
Previous Message Ravi Chemudugunta 2008-10-29 21:41:38 Re: using plpgsql debuggers