首页 > 技术文章 > oracel常用知识

ng1991 2017-09-28 18:29 原文

1、  drop table并不会直接删除表,而是表放进回收站中,可恢复。若要彻底删除,用

drop table purge。

2、  semi join -–in、exists 第一张表不会返回重复记录,第二张表找到则返回

anti join –not in、not exists 第二张找不到则返回

filter—满足不了anti条件则走filter

anti 条件:

使用not in 且相应的列有 not null 约束

使用 not exists,不保证每次都用到anti join

3、select * from user_tab_columns where Table_Name='用户表';

select * from all_tab_columns where Table_Name='用户表';

select * from dba_tab_columns where Table_Name='用户表';

4、闪回

select * from employ as of timestamp to_timestamp('2011-07-07 09:00:00','YYYY-MM-DD HH:MI:SS') where last_name='yang'

5、分页

select * from (
select /*+parallel(t 4)*/ t.waybill_no,t.fee_item_amt,t.income_dt,t.currency_code,rownum rn from tt_ebil_unconfirm_waybill t where t.income_dt>=date '2016-09-01'
and t.income_dt<date '2017-09-30'
) k where k.rn<=1000000

 

推荐阅读