T-SQL常用字符串函数
生活随笔
收集整理的這篇文章主要介紹了
T-SQL常用字符串函数
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
ASCII(character_expression) 返回最左端字符的 ASCII 代碼值
CHAR(integer_expression)
UNICODE(ncharacter_expression) 按照 Unicode 標準的定義,返回輸入表達式的第一個字符的整數值。
NCHAR(integer_expression)
LOWER(character_expression) 以字符串中的字符小寫返回
UPPER(character_expression)
LTRIM(character_expression) 截斷左端英文空格
RTRIM(character_expression)
LEN(string_expression) 返回字符(不是字節)個數,不包含尾隨的英文空格
LEFT(character_expression, integer_expression) 尾隨英文空格也可能被返回
RIGHT(character_expression, integer_expression)
SUBSTRING(expression, start, length) 第一個字符的位置是 1
CHARINDEX(expression1, expression2[, start_location]) expression1 在 expression2 中的位置
PATINDEX(%pattern%, expression) pattern 應該具有通配符,如同 like
REVERSE(character_expression) 顛倒字符串
REPLACE(string_expression, string_expression2, string_expression3) 用第三個表達式替換第一個表達式中的第二個表達式
STUFF(character_expression, start, length, character_expression) 按 start、length 刪除第一個表達式的內容并在 start 位置插入第四個表達式
REPLICATION(character_expression, integer_expression) 重復字符串
SPACE(integer_expression) 重復 integer_expression 個空格
SOUNDEX(character_expression) 根據字符串情況,返回一個特定的四個長度的字符串
DIFFERENCE(character_expression, character_expression) 比較兩個表達式的 SOUNEX 返回值有幾個字符不同,返回值[0-4]
STR(float_expression[, length[, decimal]]) 返回由數字轉換成的字符串值
QUOTENAME(character_string[, quote_character])? 返回帶有分隔符的 UNICODE 字符串
select ? cast('001' ? as ? int)??? 類型轉換
CHAR(integer_expression)
UNICODE(ncharacter_expression) 按照 Unicode 標準的定義,返回輸入表達式的第一個字符的整數值。
NCHAR(integer_expression)
LOWER(character_expression) 以字符串中的字符小寫返回
UPPER(character_expression)
LTRIM(character_expression) 截斷左端英文空格
RTRIM(character_expression)
LEN(string_expression) 返回字符(不是字節)個數,不包含尾隨的英文空格
LEFT(character_expression, integer_expression) 尾隨英文空格也可能被返回
RIGHT(character_expression, integer_expression)
SUBSTRING(expression, start, length) 第一個字符的位置是 1
CHARINDEX(expression1, expression2[, start_location]) expression1 在 expression2 中的位置
PATINDEX(%pattern%, expression) pattern 應該具有通配符,如同 like
REVERSE(character_expression) 顛倒字符串
REPLACE(string_expression, string_expression2, string_expression3) 用第三個表達式替換第一個表達式中的第二個表達式
STUFF(character_expression, start, length, character_expression) 按 start、length 刪除第一個表達式的內容并在 start 位置插入第四個表達式
REPLICATION(character_expression, integer_expression) 重復字符串
SPACE(integer_expression) 重復 integer_expression 個空格
SOUNDEX(character_expression) 根據字符串情況,返回一個特定的四個長度的字符串
DIFFERENCE(character_expression, character_expression) 比較兩個表達式的 SOUNEX 返回值有幾個字符不同,返回值[0-4]
STR(float_expression[, length[, decimal]]) 返回由數字轉換成的字符串值
QUOTENAME(character_string[, quote_character])? 返回帶有分隔符的 UNICODE 字符串
select ? cast('001' ? as ? int)??? 類型轉換
總結
以上是生活随笔為你收集整理的T-SQL常用字符串函数的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: C语言程序设计的常用算法
- 下一篇: mysql问答汇集