http://dev.mysql.com/doc/refman/5.7/en/string-functions.html#function_substring-index

 ALTER TABLE w ADD new VARCHAR(4) DEFAULT 'fruit' COMMENT '2017-01-10 14:00:26__atermelon-fruit --- fruit';
UPDATE w SET new=SUBSTRING_INDEX(old,'-',-1);

SUBSTRING_INDEX()的更多相关文章

  1. mysql GROUP_CONCAT+ GROUP BY + substring_index获取分组的前几名

    mysql方法来源于:http://www.cnblogs.com/jjcc/p/5896588.html ###在网上看到一篇,非常赞的方法### 比如说要获取班级的前3名,mysql就可以用GRO ...

  2. mysql中的SUBSTRING_INDEX

    SUBSTRING_INDEX(str,delim,count) Returns the substring from string str before count occurrences of t ...

  3. mysql substring_index substring left right方法

    函数简介: SUBSTRING(str,pos) , SUBSTRING(str FROM pos) SUBSTRING(str,pos,len) , SUBSTRING(str FROM pos F ...

  4. mysql substring_index

    select * from tablename where substring_index(field1,'_',-1)=‘abc' #表中field1的值结构为123_abc

  5. mysql处理字符串的两个绝招:substring_index,concat

    mysql处理字符串的两个绝招:substring_index,concat 最近老是碰到要处理数据库中字符串的处理,发现用来用去也就是这两个函数: 1.substring_index(str,del ...

  6. SUBSTRING_INDEX ——网上的解释

    SUBSTRING_INDEX(str,delim,count)    Returns the substring from string str before count occurrences o ...

  7. Mysql字符串截取总结:left()、right()、substring()、substring_index()

    同步首发:http://www.yuanrengu.com/index.php/20171226.html 在实际的项目开发中有时会有对数据库某字段截取部分的需求,这种场景有时直接通过数据库操作来实现 ...

  8. mysql截取函数substring_index()和right()用法

    ); 以.作为截取的分隔符. ); 从第2位开始截取,截取所有的. );

  9. mySql中SUBSTRING_INDEX函数用法

    SUBSTRING_INDEX(str,delim,count) 返回字符串 str 中在第 count 个出现的分隔符 delim 之前的子串.如果 count 是一个正数,返回从最后的(从左边开始 ...

  10. mysql函数之SUBSTRING_INDEX(str,"/",-1)

    SUBSTRING_INDEX的用法: •SUBSTRING_INDEX(str,delim,count) 在定界符 delim 以及count 出现前,从字符串str返回自字符串.若count为正值 ...

随机推荐

  1. php -- 读取大文件

    在PHP中,对于文件的读取时,最快捷的方式莫过于使用一些诸如file.file_get_contents之类的函数,简简单单的几行代码就能 很漂亮的完成我们所需要的功能.但当所操作的文件是一个比较大的 ...

  2. TaintDroid下载预编译(五):TaintDroid(Android)系统编译虚拟机和真机測试

    光说不练非好汉,如今就让我们开启自己编译的系统測试!事实上懂得这些过程.就知道了Android手机系统定制的整个流程.现有的智能机都是使用Google的android开源的系统然后加入一些自己的东西. ...

  3. storm深入研究

    著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注明出处.作者:He Ransom链接:http://www.zhihu.com/question/23441639/answer/28075 ...

  4. android获取手机屏幕分辨率

    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceSt ...

  5. jQuery对象的链式操作用法分析

    可以使用下面的原则判断一个函数返回的时候是jQuery对象,即是否可以用于链式操作. 除了获取某些数据的函数,比如获取属性值"attr(name)",获取集合大小"siz ...

  6. Adobe Acrobat 不能打开在线pdf。Adobe Acrobat 应用程序正在被终止,因为内存错误

    Adobe Acrobat 应用程序正在被终止,因为内存错误. Adobe Acrobat 不能打开在线pdf. 当出现上面两种错误时. 原因可能是Acrobat的更新有问题. 解决方法:打开C:\D ...

  7. fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?

    解决方法:设置cpp文件的Precompiled Header属性设置为Not Using Precompiled Headers

  8. OpenCV学习:OpenCV介绍

    OpenCV全称是:Open Source Computer Vision Library(开源计算机视觉库). 于1999年由Intel建立,如今由Willow Garage提供支持. 跨平台,可以 ...

  9. centos7 安装zookeeper 集群

    data 创建myid  设置1 zookeeper默认端口2181  同步端口 20881 和 30881 设置zoo.cfg文件

  10. Android - Style问题

    转自:http://jingyan.baidu.com/article/c910274be7536acd361d2dca.html 转自:http://blog.sina.com.cn/s/blog_ ...