I am going to continue my series of very short articles or tidbits on Transaction SQL string functions. I will exploring the SUBSTRING() function today. The SUBSTRING() function allows a developer to slice and dice a string into pieces. It takes a source string [T], a integer starting position [S], and a the number of characters [C] to return as input parameters. It returns a string of [C] characters from position [S] as output. The example below extracts one word from a famous movie title.
1 2 |
-- Extract one word select substring('wizard of oz', 8, 2) as str_word |
1 2 3 4 5 |
output: str_word -------- of |
One thing to…