SQL string Functions

Source: Internet
Author: User

The string functions are shown in the following table:

Function Parameters Function
+ (expression,expression) Connect two or more strings, binary strings, column names
Ascⅱ (char_expr) Returns the Ascⅱ value of the leftmost character in an expression
CHAR (integer_expr) Returns the character corresponding to the Ascⅱ value represented by an integer
LOWER (char_expr) Convert uppercase characters to lowercase characters
UPPER (char_expr) Convert lowercase characters to uppercase characters
LTRIM (char_expr) Delete a space at the beginning of a string
RTRIM (char_expr) Remove the trailing space of a string
Right (char_expr,integer_expr) Returns a partial string after integer_expr characters in a char_expr string, and returns NULL when the integer_expr is negative
MySpace (integer_expr) Returns a string consisting of spaces that are equal to integer_expr values and integer_expr to NULL when negative
Str (Float_expr[,length[,decimal]]) Converts a numeric data to a string, length as a string, and decimal as the number of decimal places
STUFF (CHAR_EXPR1,START,LENGTH,CHAR_EXPR2) Deletes the length character from the start character position of the CHAR_EXPR1 character and inserts the CHAR_EXPR2 string into the start of the CHAR_EXPR1
SUBSTRING (expression,start,length) Returns the length character from the first word entered prompt of the expression
REVERSE (char_expr) Returns the reverse order of char_expr
CHARINDEX (' pattern ', expression) Returns the starting position of the specified pattern string in an expression
Difference (CHAR_EXPR1,CHAR_EXPR2) Compares two strings, returns their similarity, and returns a value of 1~4
PATINDEX ('%prattern% ', expression) Returns the starting position for the first occurrence of pattern in expression
REPLICATE (char_expr,integer_expr) Returns a string that is repeated integer_expr by char_expr
SOUNDEX (char_expr) Returns a four-code description of the similarity of the string pronunciation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.