select  initcap('guodongdong') from dual;                                  /返回字符串并将字符串的第一个字母变为大写;
  select initcap(ename) from scott.emp;                                      /针对scott.emp表中的ename开头全部大写。
  select lower(ename) from scott.emp;                                       /针对scott.emp表中的ename名字中全部小写。
  select * from scott.emp where lower(ename)='scott';                         /以防scott中有大小写。
  select upper(ename) from scott.emp;                                       /针对scott.emp表中的ename名字全部大写
  select length(ename) from scott.emp;                                       /查询scott.emp表中的ename名字所占的单词个数。
  select ename,substr(ename,length(ename)-2) from scott.emp            /查询Scott.emp表中的ename名字最后的三个英文名称。
    或者 select ename,substr(ename,-3) from scott.emp;
  select concat('guo','dongdong') from dual;                                 /CONCAT只能连接两个字符串,没有|| 强大。
  select concat(ename,sal) from scott.emp;                                   /针对scott.emp表中的名字个工资做一个连接。
  select substr('guodongdong',1,5) from dual;                               /查询guodongdong,從左邊1-5的单词列出。
  select subsrt('guodongdong',-1,5) from dual;                                /從右邊開始。
    select subsrt('guodongdong',-1) from dual;                                /截取末尾;
  select lpad('guodongdong',15,'*') from dual;                               /显示guodongdong,15表示15为,不够15为则在前方补*。
  select rpad('guodongdong',15,'*') from dual;                               /显示guodongdong,15表示15为,不够15为则在后方补*。
  select lpad(ename,length(ename)+30,'*' )from scott.emp;
  select lpad (ename,length(ename)+30,'*') from scott.emp;
  select rpad (lpad (ename,length(ename)+30,'*'),length(lpad(ename,length(ename) +30,'*')) +30,'*') from scott.emp;
  select replace('guodongdong','d','j') from dual;                           /修改guodongdong,d单词全部替换为j,则是guojongjong
  select trim('k' from  'gkgguodonkkgdonggg') from dual;                     /只要gkgguodonkkgdonggg去除指定字符的前后空格。
    ltrim
    rtrim
    三个主要函数:ROUND,trunc,mod
     1: SELECT
            round(78915.67823823),    78916,小数点之后的内容直接进行四舍五入
            round(78915.67823823,2),  78915.68,保留两位小数
            round(78915.67823823,-2), 78900,把不足5的数据取消了
            round(78985.67823823,-2), 79000,如果超过了5则进行进位
            round(-15.65)           ; -16
          from dual;
     2:截取小数,所有的小数都不进位
        SELECT
            trunc(78915.67823823),    78916,小数点之后的内容直接进行四舍五入
            trunc(78915.67823823,2),  78915.68,保留两位小数
            trunc(78915.67823823,-2), 78900,把不足5的数据取消了
            trunc(78985.67823823,-2), 79000,如果超过了5则进行进位
            trunc(-15.65)           ; -16
          from dual;
      3:求模(求余数)
          select mod(10,3) from dual; 得1

最新文章

  1. [Unity3D]自己动手重制坦克舰队ArmadaTank
  2. CMPP错误码说明
  3. jquery .post .get中文参数乱码解决方法详解
  4. jquery-ui 进度条
  5. encodeURI和encodeURIComponent的比较
  6. nyoj_471:好多的树(容斥原理)
  7. 【原】Java学习笔记010 - 数组
  8. 常见RPC开源框架
  9. STM32 一直进入串口接收中断
  10. 『计算机视觉』Mask-RCNN_推断网络其二:基于ReNet101的FPN共享网络暨TensorFlow和Keras交互简介
  11. linux命令学习 随笔
  12. PAT甲题题解-1071. Speech Patterns (25)-找出现最多的单词
  13. jQuery table td可编辑
  14. 再springMVC中自定义文件上传处理解决与原spring中MultipartResolve冲突问题
  15. package.json常用的字段
  16. MT【155】单调有界必有极限
  17. Codeforces Round #358 (Div. 2) D. Alyona and Strings dp
  18. 【C】——压缩字符串
  19. windows编程之内核对象
  20. jmeter-BeanShell Sampler

热门文章

  1. vscode已有64位版本。
  2. Error: Program type already present: com.google.gson.FieldAttributes 的解决方法
  3. Java学习必备书籍推荐终极版!
  4. 分散的配置文件VS集中的注册表
  5. 使用@JsonFormat引起的时间比正常时间慢8小时解决方法
  6. Codeforces 985 D - Sand Fortress
  7. python Django 创建应用
  8. 第 8 章 容器网络 - 050 - 创建 overlay 网络
  9. Linux中apt与apt-get命令的区别与解释
  10. (转)stm32启动文件详解