oracle中LTRIM的用法
ltrim() 函数从字符串左侧删除空格或其他预定义字符。
ltrim(string,charlist)
参数string:必需。规定要转换的字符串。
参数charlist:可选。规定从字符串中删除哪些字符。
如果未设置该参数,则全部删除以下字符:
"\0" - ASCII 0, NULL
"\t" - ASCII 9, 制表符
"\n" - ASCII 10, 新行
"\x0B" - ASCII 11, 垂直制表符
"\r" - ASCII 13, 回车
" " - ASCII 32, 空格
=====================================================================
=====================================================================
LTRIM(x,y)的英文解释是这样的:
LTRIM removes from the left end of char all of the characters contained in set. If you do not specify set, then it defaults to a single blank. If char is a character literal, then you must enclose it in single quotation marks. Oracle Database begins scanning char from its first character and removes all characters that appear in set until reaching a character not in set and then returns the result.Both char and set can be any of the datatypes CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB, or NCLOB. The string returned is of VARCHAR2 datatype if char is a character datatype, NVARCHAR2 if char is a national character datatype, and a LOB if char is a LOB datatype.
也就是按照y中的字符一个一个截掉x中的字符,并且是从左边开始执行的,只要遇到y中有的字符, x中的字符都会被截掉, 直到在x的字符中遇到y中没有的字符为止函数命令才结束 . 举个例子来说:
ltrim('abcdab','ab') 结果并不是按‘ab’字符串来截断'abcdba',而是分别按照字母a和b分别去找。
ltrim() 函数从字符串左侧删除空格或其他预定义字符。
ltrim(string,charlist)
参数string:必需。规定要转换的字符串。
参数charlist:可选。规定从字符串中删除哪些字符。
如果未设置该参数,则全部删除以下字符:
"\0" - ASCII 0, NULL
"\t" - ASCII 9, 制表符
"\n" - ASCII 10, 新行
"\x0B" - ASCII 11, 垂直制表符
"\r" - ASCII 13, 回车
" " - ASCII 32, 空格
=====================================================================
=====================================================================
LTRIM(x,y)的英文解释是这样的:
LTRIM removes from the left end of char all of the characters contained in set. If you do not specify set, then it defaults to a single blank. If char is a character literal, then you must enclose it in single quotation marks. Oracle Database begins scanning char from its first character and removes all characters that appear in set until reaching a character not in set and then returns the result.Both char and set can be any of the datatypes CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB, or NCLOB. The string returned is of VARCHAR2 datatype if char is a character datatype, NVARCHAR2 if char is a national character datatype, and a LOB if char is a LOB datatype.
也就是按照y中的字符一个一个截掉x中的字符,并且是从左边开始执行的,只要遇到y中有的字符, x中的字符都会被截掉, 直到在x的字符中遇到y中没有的字符为止函数命令才结束 . 举个例子来说:
ltrim('abcdab','ab') 结果并不是按‘ab’字符串来截断'abcdba',而是分别按照字母a和b分别去找。