String functions in MySQL
Function |
Function |
CONCAT (s1,s2,... sn) |
Connect S1,s1...sn to a string |
INSERT (STR,X,Y,INSTR) |
The string str starts at the x position, and the substring of y characters is replaced with the string instr |
LOWER (str) |
Turns the string str into lowercase |
UPPER (str) |
Turn string str to uppercase |
Left (str,x) |
Returns the character of the leftmost x of the string str |
Right (STR,X) |
Returns the character of the rightmost x of a string |
Lpad (Str,n,pad) |
Fill the leftmost str with a string pad until the length is N string length |
Rpad (Str,n,pad) |
Padding the rightmost of str with a string pad until the length is N string length |
LTRIM (str) |
Remove string Str left space |
RTRIM (str) |
Remove string str right space |
REPEAT (str,x) |
Returns the result of repeated x times of STR |
REPLACE (STR,A,B) |
Substitute string B for string A in str |
STRCMP (S1,S2) |
Compare String S1,s2 |
TRIM (str) |
Remove string line endings and wardrobe spaces |
SUBSTRING (Str,x,y) |
Returns a string of Y-length strings from the str x position of the string |
CONCAT: Concatenate incoming arguments into a string, any string and null join IS NULL
INSERT: The string str starts at position x, and the substring of y characters is replaced with a string instr
Lower,upper: Converts a string to lowercase or uppercase
Left,right: Returns the leftmost and rightmost x characters of the string, if the second argument is null, there will be no return
Lpad,rpad: Padding with the leftmost and rightmost characters of the string str until the length is n strings
Ltirm,rtirm: Remove string str left and right spaces
REPEAT: Returns the result of repeated x times of STR
Replace: Substitute string B for string A in str
STRCMP: The size of the ASCLL code of the string S1 and S2, if S1 is smaller than S2 return -1,s1 and S2 equals return 0,s1 greater than S2 return 1
TRIM: Removes whitespace at the beginning and end of the target string
SUBSTRING: Returns a string of y string lengths from position x in str
MySQL Learning--commonly used functions (String functions)