From: Emi Lu <emilu@encs.concordia.ca>
To: pgsql-sql@postgresql.org
Subject: Split a string to rows?
Date: Mon, 07 Jan 2013 14:44:53 -0500
Message-ID: <50EB25B5.5020502@encs.concordia.ca> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-sql>
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
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: emilu@encs.concordia.ca
Subject: Re: Split a string to rows?
In-Reply-To: <50EB25B5.5020502@encs.concordia.ca>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox