How to use Teradata OTRANSLATE() function - syntax ?
Example Scenario: How to count the number of commas in a column
id attribute 1 strength, power 2 ring, wig, puff
I need to count the number of commas
id att_number 1 2 2 3
Using Teradata's Otranslate function:
CHAR_LENGTH(col) - CHAR_LENGTH(OTRANSLATE(col, ',',''))
Read great educational content like this and a lot more !
Members get free exclusive access to content, new courses, and discounts. Signup for a free account to write a post / comment / upvote posts. Creating an account takes less than 5 seconds and you can start earning badges & points too