Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 6DCC49FBE5D for ; Fri, 12 Oct 2007 12:56:05 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 41775-05 for ; Fri, 12 Oct 2007 12:56:02 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.242]) by postgresql.org (Postfix) with ESMTP id DD8AC9FBE1C for ; Fri, 12 Oct 2007 12:56:01 -0300 (ADT) Received: by an-out-0708.google.com with SMTP id c36so52503ana for ; Fri, 12 Oct 2007 08:56:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=jV8flZHkjzlWD03F+aFzRuAr0NDjBuPF2aZLuCuE/ko=; b=Ka+3WX2ptwXIqqMisafYxu5ayXyvE/31+wkBc1ofQGL/ANEmCvafgrrFcv/0EpjzG0FsWIQknfpMTVKVxBMxpDhF2LfJARB+m8NsakPcHOZaoLBI2W4EYwPtNx+CtvwZ6HDPjpEZItgHoCr8EWi9x4Bv5j9se5JPJUj+fLHYE4c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=P3wLcpl3i1JSOsER6zex+8RQ+CxAwFmdJAxLcwZrcVCLf4jJLTQtuskKY00iPAaxh2TDF1ztCWRYUNWYf41/g/1myDD/b7hlKmPzqt/HGe+XjHdYBO3bB8bJR2NjFt7vDYOUgy2gRKkO4hqegKXWXzzmN0SPVNHRq1bIOP7TlcY= Received: by 10.142.89.9 with SMTP id m9mr1056885wfb.1192204559820; Fri, 12 Oct 2007 08:55:59 -0700 (PDT) Received: by 10.143.8.5 with HTTP; Fri, 12 Oct 2007 08:55:59 -0700 (PDT) Message-ID: <36e682920710120855oe36e034s387b0fdc24ecb11c@mail.gmail.com> Date: Fri, 12 Oct 2007 11:55:59 -0400 From: "Jonah H. Harris" To: "Andreas Joseph Krogh" Subject: Re: OT: array_accum equivalent in Oracle Cc: pgsql-sql@postgresql.org In-Reply-To: <200710121743.39228.andreak@officenet.no> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200710121616.28023.andreak@officenet.no> <36e682920710120802u4c8fa4c9xc7021f59c5579ba@mail.gmail.com> <200710121743.39228.andreak@officenet.no> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/64 X-Sequence-Number: 29436 On 10/12/07, Andreas Joseph Krogh wrote: > > Something like this: > > > > CREATE TYPE varchar2_table_t AS TABLE OF VARCHAR2(32767); > > SELECT job, CAST(MULTISET(SELECT ename FROM emp WHERE job = e.job) AS > > varchar2_table_t) FROM emp e GROUP BY job; > > Amazing! Works like a charm. > I was envisioning some pretty ugly PL/SQL functions to accomplish this. > > Thanks! No problem. -- Jonah H. Harris, Sr. Software Architect | phone: 732.331.1324 EnterpriseDB Corporation | fax: 732.331.1301 499 Thornall Street, 2nd Floor | jonah.harris@enterprisedb.com Edison, NJ 08837 | http://www.enterprisedb.com/