摘要: 1.to_number() select to_number('2015') from dual 2015 2.to_char() --不需要转换格式 select to_char(2015) from dual '2015' --需要转换格式 select to_char(1, '$000') f 阅读全文
posted @ 2020-04-22 14:33 码农阿亮 阅读(761) 评论(0) 推荐(0) 编辑
摘要: row_number() 核心语句如下: over(partition by colum1 order by colum2 (colum2 可以等于colum1 )desc) row_number函数返回一个唯一的,当遇到相同的数据时,排名按照记录集中记录的顺序依次递增,不同数据进行依次排名 Sel 阅读全文
posted @ 2020-04-22 14:27 码农阿亮 阅读(1002) 评论(0) 推荐(0) 编辑
摘要: concat(exp1,exp2) 把exp1和exp2拼接在一起,通常用在百分比中 select concat('abc','ba') from dual abcba select concat('100','%') from dual 100% select concat(100,'%') fr 阅读全文
posted @ 2020-04-22 14:20 码农阿亮 阅读(2376) 评论(0) 推荐(0) 编辑
摘要: Ceil(value) 函数返回大于等于指定值(value)的最小整数,取整,没有四舍五入这一说法 select Ceil(103.46) from dual 104 select Ceil(103.46) from dual 104 阅读全文
posted @ 2020-04-22 14:18 码农阿亮 阅读(6712) 评论(0) 推荐(1) 编辑
摘要: floor(value) 函数返回小于或等于指定值(value)的最小整数,取整,没有四舍五入这一说法 select floor(103.56) from dual 103 select floor(103.46) from dual 103 阅读全文
posted @ 2020-04-22 14:16 码农阿亮 阅读(5864) 评论(0) 推荐(0) 编辑
摘要: trunc(exp1) trunc(exp1)和Round(exp1,exp2)类似,只不过trunc()不指定截取的小数位数进行处理,只取到整数位,不做舍去处理 select trunc(123.1234) from dual 123 select trunc(123.9234) from dua 阅读全文
posted @ 2020-04-22 14:14 码农阿亮 阅读(986) 评论(0) 推荐(0) 编辑
摘要: Round(exp1,exp2)函数具有四舍五入的功能,分为以下两种情况: 1.exp2数为非负 四舍五入的位数从小数点后开始计数,小数点后|exp2|位,看後一位,进本位,后面舍去 select Round(125.455,0) from dual 125 select Round(125.455 阅读全文
posted @ 2020-04-22 14:10 码农阿亮 阅读(6077) 评论(0) 推荐(0) 编辑
摘要: 简介: sign(exp)函数根据exp是零、正数还是负数,分别返回0、1、-1 格式 select sin(exp) from db_table 例子 select sign(sale-6000) from db_table select username ,dept, sale, decode( 阅读全文
posted @ 2020-04-22 09:21 码农阿亮 阅读(754) 评论(0) 推荐(0) 编辑
摘要: NVL(exp1,exp2)函数时判断判断某个值是否为null。若为null,则返回exp2,否则返回exp1 格式1 select nvl(exp1,exp2) from db_table 例子 select monthid,decode(nvl(sale,6000),6000,'NG','OK' 阅读全文
posted @ 2020-04-22 09:17 码农阿亮 阅读(807) 评论(0) 推荐(0) 编辑