zoukankan      html  css  js  c++  java
  • sql里的常用单行行数

    length(参数值) 返回参数的字节个数

    select length('zhangsan')  ----->8

    concat(参数一,参数二)将参数一跟参数二拼接起来

    select concat('zhangsan','-','@@@@@@@')  ----->zhangsan-@@@@@@@

    upper(参数) 将该参数变为大写

    select upper('zhangsan')  --->ZHANGSAN

    lower(参数)将该参数变为小写

    select lower('ZHANGSAN')--->zhangsan

    索引从1开始,包含开始索引字符

    strsub(参数,索引,字符长度)

    select substr('helloworld',6,3)

    instr(参数、子串)返回子串在参数中第一次出现的索引,如果找不到返回0

    select instr('helloworld','l') ---->3

    trim(参数)去除参数两端的空格

    select trim('               hello             ')----->hello

    trim('两端要去除的参数' from '字符串')

    select trim( 'a' from'aaaaaaaaaaaaaahelloaaaaaaaaaaaaaa') ----->hello

    lpad(参数,长度,填充字符) 用指定的字符去实现左填充长度,长度小于字符串,则输出截取相应长度的字符

    select lpad('hello',2,'$') 

    rpad(参数,长度,填充字符) 用指定的字符去实现右填充长度,长度小于字符串,则输出截取相应长度的字符

    select rpad('hello',4,'$')

    repalce('字符串','被替换的字符','替换后的字符')

    select replace('helloword','word','NewWorld');

  • 相关阅读:
    selenium+python处理Alert弹窗
    HTML在网页上不能显示图片问题
    制作python程序windows安装包(飞机大战源码)
    python读取ini文件
    python杀死Windows后台程序
    python3中文乱码解决方法
    算法04
    Windows10
    Windows10 快捷键
    文件夹选项-安装功能-window服务
  • 原文地址:https://www.cnblogs.com/kukai/p/12747274.html
Copyright © 2011-2022 走看看