摘要:
条件有rownum的时候出现扫描表,到前n行停止 阅读全文
摘要:
技巧2:union 代替or的情况当SQL语句中,or 条件上面有一个为子查询,并且子查询上的表与源表不同,这个时候就可以用union代替or或者你发现执行计划中的 filter 有 or 并且 or 后面跟上子查询(EXISTS...)的时候就要注意,比如:2 - filter("T"."LRR_... 阅读全文
摘要:
示例如下(请自己动手实验):create table test1 as select * from dba_objects;create table test2 as select * from dba_objects;create index idx1 on test1(object_id);cr... 阅读全文
摘要:
SQL> create table t1(id1 char(2),id2 char(2),id3 char(2));Table created.SQL> desc t1 Name Null? Type ---------------------------------------... 阅读全文
摘要:
SQL> set linesize 200SQL> set pagesize 200SQL> set autot traceSQL> select distinct department_name from hr.departments dept, hr.employees emp where ... 阅读全文
摘要:
SQL> create table t as select * from dba_objects; Table created. SQL> create index idx_t on t(object_id); Index created. SQL> BEGIN 2 ... 阅读全文
摘要:
SQL> create table t as select * from dba_objects; Table created. SQL> create index idx_t on t(object_id); Index created. SQL> BEGIN 2 ... 阅读全文
摘要:
SQL> show parameter pgaNAME TYPE VALUE------------------------------------ ----------- ------------------------------pga_aggregate_target big integer ... 阅读全文
摘要:
ipcs:-q Writes information about active message queues-o Writes the following usage information: * Number of messages on queue * Total number of bytes... 阅读全文
摘要:
select ename,sal,sum(sal) over (partition by ename order by sal,empno) as running_totalfrom emp1order by 2按ename 汇总salover()开窗函数和聚合函数的不同之处是对于每个组返回多行,而... 阅读全文