Home > Database > Mysql Tutorial > sql字符串函数大全(1/3)

sql字符串函数大全(1/3)

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 17:47:47
Original
1113 people have browsed it

sql字符串函数大全,包括有很多如去空格函数 取子串函数 字符串比较函数 字符串操作函数 数据类型转换函数 日期函数 等的操作都有详细的说明

sql字符串函数大全,包括有很多如去空格函数   取子串函数 字符串比较函数  字符串操作函数 数据类型转换函数  日期函数
等的操作都有详细的说明啊。

去空格函数
1、ltrim() 把字符串头部的空格去掉。

2、rtrim() 把字符串尾部的空格去掉。

三、取子串函数
1、left()
left ()
返回character_expression 左起 integer_expression 个字符。

2、right()
right ()
返回character_expression 右起 integer_expression 个字符。

3、substring()
substring (, length)
返回从字符串左边第starting_ position 个字符起length个字符的部分。

四、字符串比较函数
1、charindex()
返回字符串中某个指定的子串出现的开始位置。
charindex (, )
其中substring _expression 是所要查找的字符表达式,expression 可为字符串也可为列名表达式。如果没有发现子串,则返回0 值。
此函数不能用于text 和image 数据类型。
2、patindex()
返回字符串中某个指定的子串出现的开始位置。
patindex (, )其中子串表达式前后必须有百分号“%”否则返回值为0。
与charindex 函数不同的是,patindex函数的子串中可以使用通配符,且此函数可用于char、 varchar 和text 数据类型。 

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
sql file
From 1970-01-01 08:00:00
0
0
0
php - Overhead of prepare vs sql?
From 1970-01-01 08:00:00
0
0
0
Print sql statement
From 1970-01-01 08:00:00
0
0
0
Pass array to SQL insert query using PHP
From 1970-01-01 08:00:00
0
0
0
sql optimization or
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template