Sql—substr()

Mysql中字符串切割函数substr

使用格式:

SUBSTR(string,start,length):

string:待分割的字符串

start:切分起始位置,注意mysql中位置从1开始

length:切分的长度

str("helloworld",6,5)

SELECT SUBSTR("helloworld",6,5);

+--------------------------+

| SUBSTR("helloworld",6,5) |

+--------------------------+

| world                    |

+--------------------------+


猜你喜欢

转载自blog.csdn.net/colin_yjz/article/details/50554004