Re: [SQL] Split a string to rows?

2013-01-07 Thread Thomas Kellerer
Emi Lu wrote on 07.01.2013 21:16: Thanks a lot! I just noticed that my postgresql is 8.3(unnest function is not there by default). Is there a way that I could download and load only this function from somewhere? Are you aware that 8.3 will be de-suppported as of next month? You should really

Re: [SQL] Split a string to rows?

2013-01-07 Thread Emi Lu
All right. I found the function. http://wiki.postgresql.org/wiki/Array_Unnest Thanks a lot! Emi On 01/07/2013 03:16 PM, Emi Lu wrote: Thanks a lot! I just noticed that my postgresql is 8.3(unnest function is not there by default). Is there a way that I could download and load only this function

Re: [SQL] Split a string to rows?

2013-01-07 Thread Emi Lu
Thanks a lot! I just noticed that my postgresql is 8.3(unnest function is not there by default). Is there a way that I could download and load only this function from somewhere? Thanks again! Emi On 01/07/2013 02:58 PM, Jonathan S. Katz wrote: On Jan 7, 2013, at 2:44 PM, Emi Lu wrote: Hell

Re: [SQL] Split a string to rows?

2013-01-07 Thread Jonathan S. Katz
On Jan 7, 2013, at 2:44 PM, Emi Lu wrote: > 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 You can probably use some combinat

Re: [SQL] Split a string to rows?

2013-01-07 Thread Steve Crawford
On 01/07/2013 11:44 AM, Emi Lu wrote: Is there a function to split a string to different rows?... Have you looked at regexp_split_to_table? Cheers, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/p

[SQL] Split a string to rows?

2013-01-07 Thread Emi Lu
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