SUBSTRING_INDEX(str,delim,count)

按标识符截取指定长度的字符串

 mysql> SELECT SUBSTRING_INDEX('www.mysql.com', '.', 2);
-> 'www.mysql'
mysql> SELECT SUBSTRING_INDEX('www.mysql.com', '.', -2);
-> 'mysql.com'

TRIM([{BOTH | LEADING | TRAILING} [remstr] FROM] str), TRIM([remstr FROM] str)

删除字符串前后的特定字符或者字符串,默认删除空格,默认两端都删

 mysql> SELECT TRIM('  bar   ');
-> 'bar'
mysql> SELECT TRIM(LEADING 'x' FROM 'xxxbarxxx');
-> 'barxxx'
mysql> SELECT TRIM(BOTH 'x' FROM 'xxxbarxxx');
-> 'bar'
mysql> SELECT TRIM(TRAILING 'xyz' FROM 'barxxyz');
-> 'barx'

CONCAT(str1,str2,...)

连接子字符串,如果有一个字符串为空,将返回NULL

 mysql> SELECT CONCAT('My', 'S', 'QL');
-> 'MySQL'
mysql> SELECT CONCAT('My', NULL, 'QL');
-> NULL
mysql> SELECT CONCAT(14.3);
-> '14.3'
mysql> SELECT 'My' 'S' 'QL';
-> 'MySQL'

FORMAT(X,D[,locale])

 mysql> SELECT FORMAT(12332.123456, 4);
-> '12,332.1235'
mysql> SELECT FORMAT(12332.1,4);
-> '12,332.1000'
mysql> SELECT FORMAT(12332.2,0);
-> '12,332'
mysql> SELECT FORMAT(12332.2,2,'de_DE');
-> '12.332,20'

Mysql String Functions的更多相关文章

  1. jQuery String Functions

    In today's post, I have put together all jQuery String Functions. Well, I should say that these are ...

  2. Part 11 string functions in sql server

    Built in string functions in sql server 2008 LEFT, RIGHT, CHARINDEX and SUBSTRING functions in sql s ...

  3. MySQL Information Functions

    Table 12.18 Information Functions Name Description BENCHMARK() Repeatedly execute an expression CHAR ...

  4. Java,mysql String与date类型转换

    String 与 date类型转换 字符串转换成日期类型: SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");//小写 ...

  5. mysql string 列类型

    CHAR和VARCHAR CHAR和VARCHAR类型声明的长度表示你想要保存的最大字符数 char 0~255 尾部填充空格到指定长度,检索时自动去掉空格. varchar 0~65535 VARC ...

  6. [Training Video - 4] [Groovy] String Functions

    def x="I like to read books before bed" def temp = x.split(" ") log.info "S ...

  7. mysql string types ---- mysql 字符类型详解

    一.mysql 中包涵的字符类型: [national] char [(m)] [character set charset_name] [collate collation_name] [natio ...

  8. 【python】string functions

    1.str.replace(word0,word1)  ##用word1替换str中所有的word0 >>> 'tea for too'.replace('too', 'two') ...

  9. [mysql] mysql如何实现更新一条记录中某个字段值的一部分呢?

    场景:在平常我们使用word文档等等office办公软件时,我们常会使用搜索->替换的功能. mysql: 在mysql 中有时候,我们也需要这样子的实现: 实现 SQL 语句: update ...

随机推荐

  1. Linux信号处理

    给进程设置僵尸状态的目的是维护子进程的信息,以便父进程在以后某个时间获取.这些信息包括子进程的进程ID.终止状态以及资源利用信息(CPU时间,内存使用量等等).如果一个进程终止,而该进程有子进程处于僵 ...

  2. 30天,App创业从0到1【7.12西安站】

    活动概况 时间:2015年07月12日13:30-16:30 地点:汇天使咖啡(高新路36号智空间二楼) 主办:APICloud.UPYUN.万紫网络 网址:www.apicloud.com 费用:免 ...

  3. php 扩展dll

    一.准备工作: 注:php5.2没有vc9,php5.3.php5.4没有vc6.呵呵.PHP5.5开始,不支持xp和win2003了,更是vc11了.--------------->所以,扩展 ...

  4. Android中读取短信信息

    Android中读取的短信文件有 ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 /**  * 所有的短信  */ public static final Strin ...

  5. [ROS] slam_gmapping

    slam_gmapping节点 1)slam_gmapping 节点在sensor_msgs/LaserScan消息内获取数据并建立地图 map(nav_msgs/OccupancyGrid).该地图 ...

  6. hadoop NameNode HA 和ResouceManager HA

    官网配置地址: HDFS HA : http://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-hdfs/HDFSHighAvai ...

  7. 统计哪些程序占用了swap

    命令如下 : for i in `cd /proc;ls |grep "^[0-9]"|awk ' $0 >100'` ;do awk '/Swap:/{a=a+$2}END ...

  8. curl获得http响应码 302 和绑定host

    shell curl 取得HTTP返回的状态 获取状态码 curl -I -m 10 -o /dev/null -s -w %{http_code} www.baidu.com 获取时间   curl ...

  9. mysql management note

    related url : http://willvvv.iteye.com/blog/1563345 http://lxneng.iteye.com/blog/451985    这篇文章对vari ...

  10. bash 截取字符串

    转载自http://blog.chinaunix.net/uid-1757778-id-3162034.html 命令的2种替换形式 $()和 ``示例:截断字符串    a):    #截取文件名称 ...