How to use Teradata OTRANSLATE() function - syntax ?
Example Scenario: How to count the number of commas in a column
Table
id attribute\n1 strength, power\n2 ring, wig, puff
I need to count the number of commas
id att_number\n1 2\n2 3
Solution:
Using Teradata's Otranslate function:
CHAR_LENGTH(col) - CHAR_LENGTH(OTRANSLATE(col, ',',''))
\n\n
nVector
posted onEnjoy great content like this and a lot more !
Signup for a free account to write a post / comment / upvote posts. Its simple and takes less than 5 seconds
Post Comment