MySQL 字符串截取函数;
时间:2021-07-01 10:21:17
帮助过:12人阅读
mysql> select left(‘example.com‘, 3
);
+-------------------------+
| left(‘example.com‘, 3) |
+-------------------------+
| exa |
+-------------------------+
2. 字符串截取:right(str,
length)
mysql> select right(‘example.com‘, 3
);
+--------------------------+
| right(‘example.com‘, 3) |
+--------------------------+
| com |
+--------------------------+
//从一个字段取后两位字符更新到另外一个字段
update `historydata` set `last2`=right(last3, 2);
View Code
_________
MySQL 字符串截取函数;
标签:bsp lap pen open last dex logs blog mysql