mysql 字符串截取
1、从左开始截取字符串
left(str,length)被截取字段,截取长度
select left('admin1213',5) from table

2、从右开始截取字符串
right(str,length)被截取字段,截取长度
select right('admin1213',5) from table
3、截取字符串
substring(str,pos)被截取字段,从第几位截取
select substring('admin1213',5) from table

substring(str,pos,length)被截取字段,从第几位截取,截取长度
select substring('admin1213',5,3) from table

mysql截取字符串的更多相关文章

  1. mysql 截取字符串 函数

    文章摘取自http://www.cnblogs.com/zdz8207/p/3765073.html 练习截取字符串函数(五个) mysql索引从1开始 一.mysql截取字符串函数 1.left(s ...

  2. mysql截取字符串与reverse函数

    mysql的函数大全: http://www.jb51.net/Special/606.htm 这个网页上很多知识点,可以学习下,关于mysql的函数,也可以作为API查询: 这里只说下mysql的截 ...

  3. MySQL截取字符串函数方法

    函数: 1.从左开始截取字符串 left(str, length) 说明:left(被截取字段,截取长度) 例:select left(content,200) as abstract from my ...

  4. mysql函数之二:left,right,substring,substring_index MySQL截取字符串函数方法

    函数: 1.从左开始截取字符串 left(str, length) 说明:left(被截取字段,截取长度) 例:select left(content,200) as abstract from my ...

  5. Mysql 截取字符串总结

    MySQL 字符串截取函数:left(), right(), substring(), substring_index().还有 mid(), substr().其中,mid(), substr() ...

  6. mysql 截取字符串

    #select SUBSTRING_INDEX('1,2', ',', 1); SELECT * FROM dis_disease WHERE id = ( SELECT SUBSTRING_INDE ...

  7. mysql函数之截取字符串

    文章摘取自http://www.cnblogs.com/zdz8207/p/3765073.html 练习截取字符串函数(五个) mysql索引从1开始 一.mysql截取字符串函数 1.left(s ...

  8. mysql根据字符截取字符串(总结)

    mysql根据字符截取字符串(总结) 1.1 前言   为结合自己平常查资料的习惯,我会先给出例子,然后再对相关知识进行详解.该案例使用到的函数为:SUBSTRING_INDEX 1.2 需要实现的实 ...

  9. Mysql截取和拆分字符串函数用法

    Mysql截取和拆分字符串函数用法 截取字符串函数: SUBSTRING(commentid,9) 意思是:从第9个字符开始截取到最后.SUBSTRING的参数有三个,最后一个是截取的长度,默认是到结 ...

随机推荐

  1. Creating a settings table that can handle almost any type of value

    Update: Updated article here. Today I wanted to be able to have a table store any type of value as a ...

  2. 如何用googletest写单元测试

    http://www.uml.org.cn/c++/201203293.asp googletest是一个用来写C++单元测试的框架,它是跨平台的,可应用在windows.linux.Mac等OS平台 ...

  3. java 将GBK编码文件转为UTF-8编码

    需要commons-io-2.0.1.jar public class Test { public static void main(String args[]) throws IOException ...

  4. Qt编程之转换成8,16bit的灰度图

    代码大致是下面这样的.是8bit的灰度图,不是16bit. QString img_path = "C:\\Users\\Yajun Dou\\Desktop\\test.bmp" ...

  5. 转:SVN 出现This client is too old to work with working copy...错误

    本地进行SVN客户端版本更新,但是之前一些代码是用的旧svn客户端提交的,这时候进行代码更新或者提交代码可能会出现错误,我这边是NetBeans中提交代码就出现了以下错误:This client is ...

  6. GET: https://login.weixin.qq.com/cgi-bin/mmwebwx-bin/login? loginicon=true &uuid=odcptUu2JA==&tip=0

    GET: https://login.weixin.qq.com/cgi-bin/mmwebwx-bin/login? loginicon=true &uuid=odcptUu2JA==&am ...

  7. shell下有操作json对象的库

    http://kernelpanic.im/blog/2012/03/08/shell-manipulate-json/ Json.org推荐了两个:Jshon和JSON.sh 其中JSON.sh是完 ...

  8. bzoj1620 [Usaco2008 Nov]Time Management 时间管理

    Description Ever the maturing businessman, Farmer John realizes that he must manage his time effecti ...

  9. MVC后台绑定dropdownList

     public ActionResult Index()         {             List<SelectListItem> items = new List<Se ...

  10. Visual Assist X在Windows 8.1下出现中文乱码的解决方法

    这主要是输入法造成的,我的输入法中有US.中文.搜狗输入法三个输入法:通过搜狗输入法管理器把“中文”去掉,或者通过语言首选项把“中文”去掉就不会在出现乱码. 这个办法的思路来自于http://www. ...