Oracle取余函数mod
2015-11-20 11:18
756 查看
接下来将会和oracle存储过程打交道,一切都是新的,从基础的学起吧
今天看几个函数:
1 mod 取余函数
今天看几个函数:
1 mod 取余函数
SQL> declare 2 tmp number; 3 begin 4 for tmp in 1..10 loop 5 if mod(tmp, 2) = 0 then 6 dbms_output.put_line(tmp||' can be mod by 2.'); 7 else 8 dbms_output.put_line(tmp||' can not be mod by 2.'); 9 end if; 10 end loop; 11 exception 12 when others then 13 dbms_output.put_line('exception with :' || tmp); 14 end; 15 /结果:
1 can not be mod by 2. 2can be mod by 2. 3 can not be mod by 2. 4can be mod by 2. 5 can not be mod by 2. 6can be mod by 2. 7 can not be mod by 2. 8can be mod by 2. 9 can not be mod by 2. 10can be mod by 2. PL/SQL procedure successfully completed
相关文章推荐
- Oracle 完全理解connect by-详细脚本-可实战
- 常用Oracle分析函数详解
- oracle清除用户对象
- oracle 远程导入导出dmp文件
- Oracle Form编译路径问题
- oracle怎样把查询的null转换为0
- Oracle select * and rownum
- oracle 备份与还原 exp/imp
- Oracle执行计划不走索引的原因总结
- 看了此文,Oracle SQL优化文章不必再看(转)
- Spring+Mybatis多数据源配置(一)——MySQL与Oracle通过配置切换
- Spring+Mybatis多数据源配置(一)——MySQL与Oracle通过配置切换
- Oracle 数据库日常巡检
- Oracle EBS Interface/API(5)--AR Invoices
- ORACLE数据库如何处理回收站BIN$内容
- ORACLE数据库如何处理回收站BIN$内容
- oracle中使用group by优化distinct
- jfinal druid使用oracle的设置
- oracle中文乱码
- oracle表空间查询sql