oracle的隐藏的东东
1: 在oracle中存在一种特殊的表单:dual
这是一张伪表,不是真正存在的
在日期的查询和触发器等多处用到
只展示系统当前时间:
select sysdate from dual;
触发器:往往是和序列在一起使用的,先创建序列,在调用序列设置触发器
创建序列 -- Create sequence create sequence LX_CJ_XL minvalue 0 maxvalue 100 start with 2 increment by 1 nocache;
创建触发器 create or replace trigger Test before insert on lx_student for each row declare tmpVar number; begin tmpVar :=100; Select LX_CJ_XL.nextVal into tmpVar from dual; :New.id :=tmpVar; exception when others then raise; end Test;
2:rownum 隐含的字段,查询的结果按照自然排序:,1,2,3,4,5,..............