2009年8月27日
摘要: 自增字段: 表atable(id,a) id需要自增 首先建立一个序列: create sequence seq_atable minvalue 1 maxvalue 999999999999999999 start with 1 increment by 1 nocache 有二种方式使用自增字段: 使用序列+触发器实现自增,插入语句不需要管自增字段 如:create or replace tr... 阅读全文
posted @ 2009-08-27 12:25 一般一般 阅读(2538) 评论(0) 推荐(0) 编辑
摘要: 1) select * from T1 where exists(select 1 from T2 where T1.a=T2.a) ; T1数据量小而T2数据量非常大时,T1<<T2 时,1) 的查询效率高。 当T1和T2记录数据都非常大比如上千条时,也只能靠exists了 如果对执行速度还不满意可以加上/*+parallel(a,N)*/ 用并行来提高效率,N代表数据库负载承受下可... 阅读全文
posted @ 2009-08-27 12:20 一般一般 阅读(262) 评论(0) 推荐(0) 编辑