Re: [SQL] Help with regexp-query

2011-08-02 Thread Tim Landscheidt
Johann Spies wrote: > I am struggling a bit to do the following type of update in a table. > I want the content of a field updated like this: > Original: > '0894396e-16bf-4e63-aa52-97fe7031eec9||50a6b47c-f69c-414d-bcb6-14bbe403de5f|||' > After update: > '|0894396e-16bf-4e63-aa52-97fe7031e

[SQL] Re: [SQL] Help with regexp-query

2011-08-02 Thread Charlie
select id, regexp_replace(category, (E'\\|{2,}'), E'\|', 'g') as category from akb_articles limit 100 Backslash in regex doubled. Added global modifier to replace all occurrences. - Reply message - From: "Johann Spies" Date: Thu, Jul 28, 2011

[SQL] Help with regexp-query

2011-08-02 Thread Johann Spies
I am struggling a bit to do the following type of update in a table. I want the content of a field updated like this: Original: '0894396e-16bf-4e63-aa52-97fe7031eec9||50a6b47c-f69c-414d-bcb6-14bbe403de5f|||' After update: '|0894396e-16bf-4e63-aa52-97fe7031eec9|50a6b47c-f69c-414d-bcb6-14bb