SQL MID()
MID()/SUBSTRING() 截取文本的一部分:MID(col, start, length),起始下标从 1 开始。
Key PointsSQL,MID,SUBSTRING,截取
讲解
MID()/SUBSTRING() 截取文本的一部分:MID(col, start, length),起始下标从 1 开始。
示例
SQL
SELECT MID(name, 1, 3) AS short_name FROM Websites;Output
short_name
----------
Goo
淘宝
菜鸟
微博
Fac讲解
MID()/SUBSTRING() 截取文本的一部分:MID(col, start, length),起始下标从 1 开始。
示例
SQL
SELECT MID(name, 1, 3) AS short_name FROM Websites;Output
short_name
----------
Goo
淘宝
菜鸟
微博
Fac