Re: spring a string to rows (Postgresql 8.4)

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: spring a string to rows (Postgresql 8.4)
Date: 2013-01-07 19:54:31
Message-ID: kcf957$jpd$1@ger.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Emi Lu wrote on 07.01.2013 20:44:
> Hello,
>
> Is there a function to split a string to different rows?
>
> For example, t1(id, col1)
> values(1, 'a, b, c');
>
> select id, string_split_to_row(col1, ',');
>
> Return:
> =========
> 1, a
> 1, b
> 1, c
>
> Thanks alot!
> Emi
>
>
>
>

select id, regexp_split_to_table(col1, ',')
from t1;

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Moshe Jacobson 2013-01-07 19:55:29 Re: spring a string to rows (Postgresql 8.4)
Previous Message Raymond O'Donnell 2013-01-07 19:52:49 Re: spring a string to rows (Postgresql 8.4)