Search Postgresql Archives

Re: Horizontal aggregation?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




>> >>
>> >> 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


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux