Oracle基本用法补充学习
2017-10-23 20:32
351 查看
1字符串函数
(1)大小写转换函数Lower(待转换的字符串),将大写转换成小写
(1)大小写转换函数Lower(待转换的字符串),将大写转换成小写
select Lower(ename) from emp ;(2)将小写转换成大写
select Lower(ename) from emp ;(3)将字符串的首字母大写
select initcap(ename) from emp ;(4)将两个字符串连接起来 (注意只能存在两个字符串)
select concat(ename,'hello') from emp ;
这里需要注意 concat只能连接两个字符串 ,而||可以连接多个字符串
--concat只能连接两个字符串,连接多个需要嵌套调用不方便 SQL> select concat('aa','bb') from dual; CONCAT('AA','BB') ----------------- aabb --||直接连接多个字符串 SQL> select 'aa'||'bb'||'cc' from dual;
(5)截取字符串substr 存在3个参数select sub('HelloWorld',1,5) from dual ;
(6)查看字符串的长度lengthselect length(ename) from emp ;
(7)获得字符串某个字符的下标instrselect instr('Helloworld',5) from dual ;(8)补齐字符串Lpad Rpadselect lpad("Hello",'10','*'') from dual ; select rpad("Hello",'10','*') from dual ;(9) trim函数select trim(H from 'HelloWorld') from dual ; ----- elloWorld
(10) replace函数select replace('abcde','e','o') from dual ; ------ abcdo2数字函数round(45.926,2) ------ 45.93 trunc 截断 trunc(45.926,2) ----45.92 mod 求余 mod(1600,300) ----100
相关文章推荐
- 【学习总结】Oracle数据的基本用法
- Canvas 基本用法学习笔记
- android 开发零起步学习笔记(二十一):AsyncTask的基本用法
- maven学习-基本入门用法
- 一站式学习Wireshark(一):Wireshark基本用法
- ORACLE系列学习(1)-SQL基本数据类型
- ZendFramework学习第三章(核心组件—会话处理之Zend_Session基本用法)
- EXTJS学习系列基础篇:第八篇(转载)作者殷良胜,Ext组件系列之--textfield组件的基本用法
- Android Volley学习1---简介及基本用法
- oracle学习总结---plsql基本语法
- oracle学习之bulk collect用法
- Java学习笔记之ArrayList基本用法
- Dapper学习 - Dapper的基本用法(二) - 存储过程/函数
- 学习笔记之-------UIScrollView 基本用法 代理使用
- maven学习(上)- 基本入门用法
- Oracle 零基础学习第一天——简介和基本命令学习
- IOS 开发学习28 NSArray 基本用法
- zookeeper学习笔记-基本用法进阶
- 学习笔记--Git 基本用法
- ORACLE学习笔记-ORACLE(基本命令)