Re: [SQL] find and replace the string within a column

2010-09-24 Thread Leif Biberg Kristensen
On Friday 24. September 2010 13.34.12 Craig Ringer wrote: > On 24/09/2010 5:15 PM, Nicholas I wrote: > > > Example: > > table name person: > > > > name > > > > Samuel (S/o Sebastin ) > > - > > > > remove the word within the b

Re: [SQL] find and replace the string within a column

2010-09-24 Thread Craig Ringer
On 24/09/2010 5:15 PM, Nicholas I wrote: Example: table name person: name Samuel (S/o Sebastin ) - remove the word within the brackets. the output should be , Samuel. Can't you just regexp_replace, matching \([^)]+\) (i

Re: [SQL] find and replace the string within a column

2010-09-24 Thread Jayadevan M
Hello, > the below one help's me to find the data within the two brackets. > > SELECT name,(REGEXP_MATCHES(name, E'\\(.+?\\)'))[1] from person; > regexp_matches > > (S/o Sebastin ) > - > Trying to work with your code - upda

[SQL] find and replace the string within a column

2010-09-24 Thread Nicholas I
Hi, the data in my table, have a substring enclosed in parenthesis, 1. i want to replace the string with the brackets to null or any other value. 2. remove the contents within brackets. Example: table name person: name Samuel (S/o Sebastin )