Oracle分页查询,check
2015-11-23 15:28
441 查看
(一)分页查询
分页查询根据rownum(行号)来进行分页限制,其中要用嵌套的select语句来进行查询。
(二)check语句
check的语句就是检查,在存储数据的时候,是否有不符合表的数据插入。不符合则不能插入。
(三)NOT NULL约束
分页查询根据rownum(行号)来进行分页限制,其中要用嵌套的select语句来进行查询。
!--第一层的rownum需要在order by rownum 排序之后查询出来 select * from(select t2.* from (select rownum r,t.* from emp t order by rownum) t2 where t2.r>=1) t3 where t3.r<=5
(二)check语句
check的语句就是检查,在存储数据的时候,是否有不符合表的数据插入。不符合则不能插入。
create table test_table( t_id number(10), t_name varchar2(10), t_age number(2), constraint check_age check (t_age>18 and t_age<36) ) !--当向表中插入的t_age不在限制范围内,就会报错。 !--当表创建成功之后添加check,前提是表中的t_age都符合现在添加的限制条件,否则会出现违反检查约束条件错误 alter table test_table add constraint check_age check (t_age>18 and t_age<60) !--删除check检查约束 alter table test_table drop constraint check_age
(三)NOT NULL约束
!--根据上面的表设置非空约束 alter table test_table modify t_name not null !--设置为可以为null alter table test_table modify t_name null
相关文章推荐
- 基于 Red Hat 的发行版 Oracle Linux 正式发布Oracle Linux 7.1
- Oracle Containers for J2EE远程安全漏洞(CVE-2014-0413)
- Oracle 10g R2不能使用EM的问题
- 表空间操作
- PreparedStatement中in子句的处理
- VMware下RedHat4.8_64位安装Oracle 10g RAC--简略脚本
- oracle sql日期比较
- 基于 Red Hat 的发行版 Oracle Linux 正式发布Oracle Linux 7.1
- OS block size和Oracle block size,查找OS Blocksize的方法
- oracle中创建数据库和表空间的几点总结
- 数据库自动备份脚本
- more、less 和 most 的区别
- oracle的nvl函数的使用介绍
- 解决oracle用户连接失败的解决方法
- oracle的一些tips技巧
- Oracle 下的开发日积月累
- Oracle存储过程之数据库中获取数据实例
- Windows下ORACLE 10g完全卸载的方法分析
- Oracle 函数大全[字符串函数,数学函数,日期函数]第1/4页