SQL intercept string [go from network]
Mysql:
1, LOCATE (substr, str): Returns the position of the substring substr the first occurrence in the string str, or 0 if the character substr does not exist in the string str;
2, POSITION (substr in str): Returns the position of the substring substr the first occurrence in the string str, if the character substr does not exist in the string str, the same as the locate function;
3, left (str, length): The interception of the str,length is the length of interception;
4. Right (str, length): Interception of Str,length is the length of interception;
5,substring_index (str, SUBSTR, N): Returns the character substr the string before the nth occurrence of the position in STR; Intercept area coding
6, SUBSTRING (str, n, m): Returns the string str is truncated from the nth character to the first m character;
7. Replace (str, n, m): replaces the n character in the string Str with the M character;
8, Length (STR): Calculates the length of the string str;
MySQL function Daquan: http://www.jb51.net/article/42906.htm
Sql server:
1, CHARINDEX (substr, str): Returns the position of the substring substr the first occurrence in the string str, or 0 if the character substr does not exist in the string str;
2, left (str, length): The interception of the str,length is the length of interception;
3. Right (str, length): Interception of Str,length is the length of interception;
4, SUBSTRING (str, n, m): Returns the string str is truncated from the nth character to the first m character;
5. Replace (str, n, m): replaces the n character in the string Str with the M character;
6, LEN (STR): Calculates the length of the string str;
SQL Server Functions Daquan: https://wenku.baidu.com/view/e2e19dec172ded630b1cb628.html###
Oracle
1, SUBSTR (String,start_position,[length]) substring, return string;
A, substr ("ABCDEFG", 0);//return: ABCDEFG, intercept all characters;
B, substr ("ABCDEFG", 2);//return: CDEFG, intercept all characters from the beginning of C;
C, substr ("ABCDEFG", 0, 3);//return: ABC, intercept starting from a 3 characters;
D, substr ("ABCDEFG", 0, 100);//returns: Abcdefg,100 the maximum number of preprocessed strings is returned, although the length of the preprocessing string is exceeded, but the returned result is not affected;
E, substr ("ABCDEFG",-3);//return: EFG, note parameter-3, negative when the value is calculated from the end, the string arrangement position unchanged;
2, INSTR (string,substring,position,ocurrence) find the string position;
String: Source string
SubString: substring to find
Position: Where to find start
Ocurrence: A substring of the first occurrence of a source string
3. Replace (strsource, STR1, STR2) replaces str1 in strsource with str2;
4, LENGTHB (string) calculates the byte length of a string: Returns the length of the strings, in bytes;
Length (String) calculates the string's characters: the length of the returned strings, in characters;
SQL intercept string [go from network]