Accumulation summary: SQL interception string

1.substring function-intercept string
SUBSTRING (expression, start, length)

expression——字符串、二进制字符串、文本、图像、列或包含列的表达式。请勿使用包含聚合函数的表达式。

start——整数或可以隐式转换为int 的表达式,指定子字符串的开始位置。

length——整数或可以隐式转换为 int 的表达式,指定子字符串的长度

left(field,length) ——函数返回field最左边的length个长度的字符串

right(field,length)——函数返回field最右边的length个长度的字符串

eg1: take a fixed length and fixed position string

select substring('abdcsef',1,3)

result: abd

Guess you like

Origin blog.csdn.net/weixin_41812784/article/details/111692861