對于scott用戶的emp表除了用自連接查詢員工和他的直接上司外,還可以用層次化查詢語句完成,一種寫法如下
select e.ename 員工, prior e.ename 直接上司 from emp e
start with e.empno=7839
connect by prior e.empno=e.mgr;
select e.ename 員工, prior e.ename 直接上司 from emp e
start with e.empno=7839
connect by prior e.empno=e.mgr;
2017-05-24
分組后過濾是having子句,group by是分組函數
having 和 where有類似的地方,但是where子句中不能使用組函數(類似于AVG)
(他們都是分組過濾函數)
having 和 where有類似的地方,但是where子句中不能使用組函數(類似于AVG)
(他們都是分組過濾函數)
2017-05-21