1. the string function ASCII () converts a character to an ascii code, ASCII ('abc') = 97 char (), and ASCII code to the characters low (), upper () STR (a, B, c) converts numbers to strings. A is the string to be converted. B Indicates the length after conversion, and C indicates the number of decimal places. STR (123.456, 123.46) = ltrim (), rtrim () Left (N), right (N), substring (STR, start, length) take the character string charindex (Child string, parent string) and check whether it contains the character string. Returns the location where the first occurrence occurs. The 0 patindex ('% pattern %', expression) function is the same as the previous one. However, the wildcard replicate ('Char ', rep_time) is used ), duplicate string reverse (char), reverse string Replace (STR, strold, strnew) replace string space (N), generate n blank lines stuff (), select stuff ('abcdef ', 2, 3, 'ijklmn ') = 'aijklmnef', 2 is the start position, 3 is the length of the character to be deleted from the original string, and ijlmn is the string to be inserted. 2. type Conversion Function: Cast, cast (expression as data_type), example: Select substring (title, 1, 30) as title, ytd_sales from titles where cast (ytd_sales as char (20 )) like '3% 'convert (data_type, expression) 3. date functions Day (), month (), Year () dateadd (datepart, number, date), datapart specifies that the part is added, number knows how much to add, date specifies the base on which to add. Datepart values include year, quarter, month, dayofyear, day, week, hour, minute, and second. For example, dateadd (day, 1, getdate () datediff (datepart, date1, date2 ). datapart is the same as above. The result of the function is the part of date2-date1 datename (datepart, date), and the string is returned. Datepart (datepart, date) is a part and an integer is returned. Getdate () current time 4. Statistical functions AVG, Count, Max, Min, Sum