SQL string function Encyclopedia, including many such as go to the space function to take a substring function string comparison function string manipulation function data type conversion function Date function
And so on the operation has a detailed description ah.
Go to the Space function
1, LTrim () The string head of the space removed.
2, RTrim () The end of the string to remove the space.
Three, take the SUBSTRING function
1, left ()
Left (<CHARACTER_EXPRESSION> <integer_expression>)
Returns the character_expression left integer_expression character.
2, right ()
Right (<CHARACTER_EXPRESSION> <integer_expression>)
Returns the character_expression right integer_expression character.
3, SUBSTRING ()
SUBSTRING (<expression>, <starting_ position>, length)
Returns the portion of Fu Qi length characters from the left-starting_ position character of the string.
Four, string comparison function
1, CHARINDEX ()
Returns the starting position of the occurrence of a specified substring in a string.
CHARINDEX (< ' substring_expression ', <expression>)
Where substring _expression is the character expression to look for, expression can be a string or a column-name expression. If no substring is found, a value of 0 is returned.
This function cannot be used for text and image data types.
2, Patindex ()
Returns the starting position of the occurrence of a specified substring in a string.
Patindex (< '%substring _expression% ', <column_ name>) The substring expression must be preceded by a percent semicolon "%" or the return value is 0.
Unlike the CHARINDEX function, wildcard characters can be used in substrings of patindex functions, and this function can be used for char, varchar, and text data types.