SUBSTRING (get part of string)
The SUBSTRING function allows a shorter string to be extracted from a longer string. The result is extracted from the source_string, starting in position, start_position (an integer value), for the number of characters, length (an integer value, if specified). The COLLATE clause forces the result set into another pre-existing collating sequence.
Format: SUBSTRING(source_string FROM start_position [FOR length] [COLLATE name])
Example: SUBSTRING('My name is William Diamond' FROM 12)
Result: ‘William Diamond’
> If the input string is NULL, then the result will be NULL.
> Access does not support SUBSTRING. Instead it uses MID(string, start [, length]) and SPLIT.
> DB2 does not support SUBSTRING. Instead it uses SUBSTR(string, start [, length]).
> MySQL uses only SUBSTRING(source_string FROM start_position) and assumes that the substring will be from the start_position to the end of the string.
> Oracle does not support SUBSTRING. It uses SUBSTR(string, start [, length]). If a negative number is entered for start, then Oracle counts backwards from the end of the string. With a negative start and with no length, it extracts all the way to the beginning. Oracle treats an empty string as NULL. SUBSTR(NULL, 1, 1) results in ‘ ‘ (an empty string).
> PostgreSQL supports SUBSTRING, but does not support COLLATE.
> SQL Server supports SUBSTRING(string, start, length), but does not support COLLATE.
Hello, I found your blog in a new directory of blogs. I dont know how your blog came up, must have been a typo, Your blog looks good. Have a nice day.
I like the way you think. Would you consider sharing more of the idea you presented?