2

I imported a file that contains email addresses (email_source). I need to join this table to another, using this field but it contains commas (,) and double quotes (") before and after the email address (eg. "johnsmith@gmail.com,","). I want to replace all commas and double quotes with a space.

What is the correct syntax in teradata?

4

2 回答 2

6

只需这样做:

REGEXP_REPLACE(email_source, '[,"]', ' ',1,0,i)

分解:

REGEXP_REPLACE(email_source, -- sourcestring
'[,"]', -- regexp
' ', --replacestring
1, --startposition
0, -- occurrence, 0 = all
'i' -- match -> case insensitive
)
于 2015-04-13T17:39:29.143 回答
5

您不需要正则表达式,简单的 oTranslate 应该更有效:

oTranslate(email_source, ',"', '  ') 
于 2015-04-13T18:08:55.677 回答