Get the App
SLTechnology News&Howtos  ›  Database  › 

SqlServer Series Notes-string function

Shulou Source: shulou.com Published: 2022-06-01 07:32:48 10月03日 Update

LEN (): calculates the string length

LOWER (), UPPER (): turn to lowercase, uppercase

LTRIM (): remove the space on the left side of the string

RTRIM (): remove the space on the right side of the string

LTRIM (RTRIM ('bb'))

SUBSTRING (string,start_position,length)

Parameter string is the main string

Start_position is the starting position of the substring in the main string, and length is the maximum length of the substring.

Commonly used string functions

ASCII () gets the ASCII code value of the leftmost character

CHAR () converts ASCII codes into characters

LOWER () converts all strings to lowercase

LEFT () is used to get part of the string starting at the left

RIGHT () is used to get part of the string starting at the right

PATINDEX () gets the earliest occurrence of a specified character in a string

REVERSE () reverses the order of characters in a string

Tags: Character string position lowercase space part length function maximum parameter right right uppercase commonly used order start reverse note Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Xiaomi Shulou Technology macOS vpn