Substring函数示例

从f_name列的前3个字符。

select substring(f_name,1,3)
from employee
SQL Server 2008中的Substring函数

Substring()函数是SQL的一个字符串函数。
它从给定字符表达式返回子字符串。

语法

SUBSTRING (expression, start, length)

其中:

expression- 指定要作为 SUBSTRING 参数给出的字符、二进制、文本或者 ntext。

start- 它是 SUBSTRING 函数参数之一,用于指定返回字符的开始位置。

length - 它指定要返回的字符数。

日期:2020-06-02 22:18:10 来源:oir作者:oir