欢迎来到天天文库
浏览记录
ID:14813165
大小:84.00 KB
页数:3页
时间:2018-07-30
《oracle中的分级查询》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、oracle中的分级查询下面以emp表和dept表为例。Sql代码 1.SQL> select * from emp; 2. 3.EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO 4.----- ---------- --------- ----- ----------- --------- --------- ------ 5. 7369 SMITH CLERK 7902 1980-12-17 800
2、.00 20 6. 7499 ALLEN SALESMAN 7698 1981-2-20 1600.00 300.00 30 7. 7521 WARD SALESMAN 7698 1981-2-22 1250.00 500.00 30 8. 7566 JONES MANAGER 7839 1981-4-2 2975.00 20 9. 7654 MARTIN SAL
3、ESMAN 7698 1981-9-28 1250.00 1400.00 30 10. 7698 BLAKE MANAGER 7839 1981-5-1 2850.00 30 11. 7782 CLARK MANAGER 7839 1981-6-9 2450.00 10 12. 7788 SCOTT ANALYST 7566 1982-12-9 3000.00
4、 20 13. 7839 KING PRESIDENT 1981-11-17 5000.00 10 14. 7844 TURNER SALESMAN 7698 1981-9-8 1500.00 0.00 30 15. 7876 ADAMS CLERK 7788 1983-1-12 1100.00 20 16. 7900 JAMES CLERK 7
5、698 1981-12-3 950.00 30 17. 7902 FORD ANALYST 7566 1981-12-3 3000.00 20 18. 7934 MILLER CLERK 7782 1982-1-23 1300.00 10 19. 20.14 rows selected 21. 22.SQL> select * from dept; 23
6、. 1.DEPTNO DNAME LOC 2.------ -------------- ------------- 3. 10 ACCOUNTING NEW YORK 4. 20 RESEARCH DALLAS 5. 30 SALES CHICAGO 6. 40 OPERATIONS BOSTON SQL>select*fromemp;EMPNOENAMEJOBMGRHIREDATESALCOMMDEPTNO--
7、--------------------------------------------------------------7369SMITHCLERK79021980-12-17800.00207499ALLENSALESMAN76981981-2-201600.00300.00307521WARDSALESMAN76981981-2-221250.00500.00307566JONESMANAGER78391981-4-22975.00207654MARTINSALESMAN76981981-9-281250.001400.00307698BLAKEM
8、ANAGER78391981-5-12850.00307782CL
此文档下载收益归作者所有