Re: Aggregate "rollup" - Mailing list pgsql-hackers

From mlw
Subject Re: Aggregate "rollup"
Date
Msg-id 3E67A884.6080901@mohawksoft.com
Whole thread Raw
In response to Re: Aggregate "rollup"  ("Merlin Moncure" <merlin.moncure@rcsonline.com>)
List pgsql-hackers

Merlin Moncure wrote:

>>-----Original Message-----
>>From: mlw [mailto:pgsql@mohawksoft.com]
>>Sent: Wednesday, March 05, 2003 3:47 PM
>>To: pgsql-hackers@postgresql.org
>>Subject: [HACKERS] Aggregate "rollup"
>>
>>I had written a piece of code about two years ago that used the
>>aggregate feature of PostgreSQL to create an array of integers from an
>>aggregate, as:
>>
>>select int_array_aggregate( column ) from table group by column
>>
>>    
>>
>
>Do I understand correctly that this still follows the normal rules for
>grouping, so that only like values are put in the array?
>
>Example: column has values 1,1,1,2,2 spread over 5 rows.
>Your query returns two rows with row1={1,1,1} and row2 = {2,2}...is this
>correct?
>
Actually, it is more intended to put all the entries in a "one to many" 
table in a single column, as:

create table classic_one_to_many
(   leftside    integer,   rightside    integer
);

create table fast_lookup as select leftside, 
int_array_aggregate(rightside) from classic_one_to_many group by leftside;




pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: I cant find it or I'm just lazy ?
Next
From: "Adam Harnett"
Date:
Subject: Unsubscribe