0

I have Table in Teradata SQL like below:

col1
-------
1234 Odp Berlin
5643 Odp Warsaw
9984 Odp Madrid

And I would like to delete "Odp " from "col1" and based on it create "col2", so as a result I need something like below:

col1            | col2
---------------------
1234 Odp Berlin | 1234 Berlin
5643 Odp Warsaw | 5643 Warsaw
9984 Odp Madrid | 9984 Madrid

How can I do that in Teradata SQL ?

dingaro
  • 2,156
  • 9
  • 29
  • Take a look here: https://stackoverflow.com/questions/5829543/how-to-parse-a-string-and-create-several-columns-from-it – VikingBlooded Dec 22 '21 at 22:36
  • could you reproduce this solution to my question ? And be aware that my question is about Teradata SQL not about MS SQl :) – dingaro Dec 22 '21 at 22:39
  • I'm not a big TD guy but to my understanding, you should be able to modify the information in the linked answer to work with TD. – VikingBlooded Dec 22 '21 at 22:51
  • 2
    Have you tried to use use the string with an empty string? Something like this SELECT Col1, oreplace(col1,'Odp ','') AS col2 FROM table_name – GoonerForLife Dec 23 '21 at 01:09

0 Answers0