zoukankan      html  css  js  c++  java
  • mysql字符串处理

    MySQL字符串操作:

    substring(column_name, "start_position");  # 从指定的位置(第二个参数, start_position)开始,取到结尾的所有字符。
    
    substring(column_name, "start_position", "length"); # 从指定的位置(第二个参数, start_position)开始,取特定长度(第三个参数指定,length)的字符。

    # 先对字符串进行分割(分割符号由第二个参数指定,delimiter),选取分割后的某一部分字符串(具体取第几个由第三个参数index指定, index取负数可以从右向左计算)
    substring_index(column_name, "delimiter", "index_of_substring");
    
    

    left(column_name, “how_many_characters_to_get_from_left”); # 从左面开始取多少个字符

    right(column_name, “how_many_characters_to_get_from_right”); # 见上条
  • 相关阅读:
    nginx一键安装脚本
    nginx动静分离之后,设置默认主页
    日志备份
    cc高防主机部署
    原型和原型链
    Git&Github分支
    Git&Github基础
    传输层协议TCP&UDP
    本地库与远程库交互
    SVG
  • 原文地址:https://www.cnblogs.com/buxizhizhoum/p/8820580.html
Copyright © 2011-2022 走看看