find and replace the string within a column
От | Nicholas I |
---|---|
Тема | find and replace the string within a column |
Дата | |
Msg-id | AANLkTi=yv6typUZDxhOjufJj2jua=OXb7cM8Lq86tRuv@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: find and replace the string within a column
Re: find and replace the string within a column |
Список | pgsql-sql |
Hi, <br /><br />the data in my table, have a substring enclosed in parenthesis, <br /><br />1. i want to replace the stringwith the brackets to null or any other value.<br />2. remove the contents within brackets.<br /><br />Example: <br/> table name person:<br /><br />name<br />------------------------------------<br />Samuel (S/o Sebastin )<br />-------------------------------------<br/><br />remove the word within the brackets.<br />the output should be , Samuel.<br/><br /> the below one help's me to find the data within the two brackets.<br /><br />SELECT name,(REGEXP_MATCHES(name,E'\\(.+?\\)'))[1] from person;<br />regexp_matches<br /> ------------------------------------<br/> (S/o Sebastin )<br /> -------------------------------------<br /><br />-NicholasI<br /><br /><br />
В списке pgsql-sql по дате отправления: