Re: generic way to retrieve array as rowset

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: generic way to retrieve array as rowset
Date: 2006-01-03 15:10:44
Message-ID: 20060103151044.GF9478@webserv.wug-glas.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

am 03.01.2006, um 16:42:08 +0200 mailte Volkan YAZICI folgendes:
> Hi,
>
> Here's a modified version of A. Kretschmer's answer. This one checks
> array_upper() sizes and depending on it, doesn't provide unnecessary
> NULL fields. HTH.
>
> SELECT id, val[s.i]
> FROM t7
> LEFT JOIN
> (SELECT g.s
> FROM generate_series(1,
> (SELECT max(array_upper(val, 1)) FROM t7)) AS g(s)
> ) AS s(i)
> ON (s.i <= array_upper(val, 1));

Cool ;-)

Andreas
--
Andreas Kretschmer (Kontakt: siehe Header)
Heynitz: 035242/47212, D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
=== Schollglas Unternehmensgruppe ===

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message FERREIRA, William (GFI INFORMATIQUE) 2006-01-03 15:16:13 build Postgresql on Solaris 64 bits
Previous Message Andrew - Supernews 2006-01-03 14:59:26 Re: POSTGRES DB 3 800 000 rows table, speed up?