Re: Horizontal aggregation?

From: hamann(dot)w(at)t-online(dot)de
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Horizontal aggregation?
Date: 2012-04-14 07:47:15
Message-ID: wolfgang-1120414094715.A0426706@amadeus3.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>> >>
>> >> Hi,
>> >>
>> >> I am looking for a feature that would select from a table with
>> >>
>> >> If such an operator exists, would there be a "remove duplicates" option?
>> >>
>> >> Regards
>> >> Wolfgang Hamann
>> >>
>> >
>> > select k, array_agg(distinct val ) from t;
>> >
>> > See the docs: http://www.postgresql.org/docs/9.1/static/sql-expressions.h=
>> tml#SYNTAX-AGGREGATES
>>
>> obviously I forgot the group by:
>>
>>
>> select k, array_agg(distinct val ) from t group by k;

Hi Abel,

thanks a lot.

Regards
Wolfgang Hamann

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Albretch Mueller 2012-04-14 09:01:10 Re: Any information about the PostgreSQL Certified Engineer program?
Previous Message hamann.w 2012-04-14 06:45:36 Re: non-static LIKE patterns