Grigory P
Grigory P

Reputation: 191

Teradata: how to remove part of a string after special character

I have list of string values like this

32HK9932GH
223943201
ISAO0-32135950142
9320WS0342/11

for all rows where appliable, i need to remove the "/" character, and everything that goes after it

how to do that? thx

Upvotes: 0

Views: 1151

Answers (2)

Marko Ivkovic
Marko Ivkovic

Reputation: 1290

Try with substring

SELECT SUBSTRING(col,0,POSITION('/' IN col)) FROM table

Upvotes: -1

Gordon Linoff
Gordon Linoff

Reputation: 1269553

One method is to use regexp_substr():

select regexp_substr(col, '^[^/]*')

Upvotes: 2

Related Questions