Extracting string after and before a Character/Pattern
'Usually we see lof of codes flying around for this extraction.Most of them difficult to remember.
An easy way is to get hold of the basics.
Function used : SUBSTRING,CHARINDEX
Substring syntax : SUBSTRING(string to search, position to start, length of characters to be extracted)
CHARINDEX (character to search, string to search) returns the position of the character in the string.
If we want to extract before the character you would put the charindex as the number of characters and start position as 0 in the substring function'...
Trackbacks
Die Kommentarfunktion wurde vom Besitzer dieses Blogs in diesem Eintrag deaktiviert.
Kommentare
Ansicht der Kommentare: Linear | Verschachtelt