PL/SQL基础(四)
2015-07-15 17:14
369 查看
PL\SQL中判断与循环 declare tmpsal emp.sal%type; begin select sal into tmpsal from emp where empno=4321; if(tmpsal<320) then dbms_output.put_line('less'); elseif(tmpsal<400) then dbms_output.put_line('mid'); else//最后没有then dbms_output.put_line('great'); end if; end; do-while declare i binary_integer=1; begin loop dbms_output.put_line(i); i:=i+1; exit while (i>=20); end loop; end; while declare i binary_integer=1; begin while i<20 loop dbms_output.put_line(i); i:=i+1; end loop; end; for declare k binary_integer; begin for k in 2..20 loop dbms_output.put_line(k); end loop; for k in reverse 2..20 loop dbms_output.put_line(k); end loop; end;
相关文章推荐
- 记一次苦逼的SQL查询优化
- 数据库连接池
- [转]MySQL 调优/优化的总结100个建议
- mongodb添加用户密码并进行配置
- [转]redis 五种数据类型的使用场景
- oracle表分区详解
- SQLServer2000在64位电脑的安装步骤
- PL\SQL基础(三)
- SQL Server 2008 126错误代码
- 【sqlserver】记录
- redis学习-5种数据类型和相关命令
- C#实现按数据库邮件列表发送邮件的方法
- MySQL Cluster Windows 安装
- Oracle 基础篇 --- 重建B树索引对性能的影响
- Jedis 连接redis超时
- redis cluster
- Oracle教程-查询(二)
- 常见数据库加密技术对比
- redis时间事件
- MySQL视图学习整理