摘要:
下面是三个语句的测试结果,测试表的数据为25341223行(千万级)SQL> alter system flush shared_pool;System alteredExecuted in 0.047 secondsSQL> select count(1) from thqlog;COUNT(1)----------25341223Executed in 12.297 secondsSQL> alter system flush shared_pool;System alteredExecuted in 0.062 secondsSQL> select count(* 阅读全文
摘要:
1 --Group_ID:用于消除Group By子句中的返回的重复记录,Group by子句不接受任何参数2 --如果某个特定的分组重复n次,那么GROUP_ID返回0—n-1之间的一个整数3 --下面是实例:4 select a.division_id, a.job_id, avg(a.salary), group_id()5 from employees2 a6 group by a.division_id, rollup(a.division_id, a.job_id)7 having group_id() = 0 /*用于消除重复*/8 order by a.divi... 阅读全文