Scalar functions
1, Uppercase: Upper ();
Select upper (column name) from table name;
2, lowercase: lower ();
Select lower (column name) from table name;
3, intercept the string: substring ();
Select substring (column name, from whom to start, intercept a few) from the table name;
4, the starting position of the specified string: charindex ();
Select CHARINDEX (' Value 1 ', column name, starting from a few) from table name;
' Value 1 ': Who to list: where to look
Select CHARINDEX (column name 1, column name 2, intercept several) from table name;
Compared to two columns
It can also be written in the Where condition to make its statement meaningful: SELECT * from table name where CHARINDEX (column name 1, column name 2, intercept several) >0;
5. Print length, go to the trailing space Len ();
Select Len (column name) from table name;
6, remove the left blank print value, LTrim ();
Select LTrim (column name) from table name;
Remove the right blank print value, RTrim ();
Select RTrim (column name) from table name;
7. Start capturing values from the leftmost column: Left ();
Select Left (column name, intercept several) from table name;
Intercept values from the rightmost of the column: Right ();
Select Right (column name, intercept several) from table name;
8, empty value: IsNull ();
Select IsNull (column name, ' xx ') from table name;
Note: If xx is empty, print empty
Database Operations (iv), scalar functions