Finishing --- sql statement query strings

a string case conversion

Designated column convert strings to lower: Lower;

Specified column string converted to uppercase: Upper.

Select friendname as strings, the Lower (FRIENDNAME) AS all lowercase,  the Upper (FRIENDNAME) AS all uppercase From tb_string

 

b Returns the number of characters that appear in the string

Len () can be obtained character length

Select friendname as string ( Len (FRIENDNAME) - Len (the Replace (FRIENDNAME, 'I', ''))) / Len times ( 'i') as specified character appears From tb_string

 

c Returns string substring

Substring (field 3) returns substring fields, the first parameter is a string, the second argument is the string index position taken, the third parameter is the number of strings taken

Select the student's name, the colleges, Substring (the institution is located, 2,3) as the colleges of string From tb_student

Result: the colleges: substring computer science, where the Academy: computer science

 

Guess you like

Origin www.cnblogs.com/Wxw1992/p/11240985.html