久久机这里只有精品,国产69精品一区二区亚洲孕妇,91精品国产综合久久婷婷香蕉,午夜久久久久久电影

最新活動:電腦PC端+手機端+微網站+自適應網頁多模板選擇-建站388元起價!!!
當前位置:主頁 > 網站建設 > oracle常用sql查詢語句部分集合(圖文)建站知識

oracle常用sql查詢語句部分集合(圖文)建站知識

時間:2023-05-22 19:05:22 閱讀: 文章分類: 網站建設 作者: 網站技術員

導讀:1建站知識這篇文章主要介紹了oracle常用sql查詢語句部分,并用圖文并茂的方式為大家進程實例說明,需要的朋友可以參考下網站建設制作企業網站建設。

網站建設制作企業網站建設

Oracle查詢語句

select * from scott.emp ;

1.--dense_rank()分析函數(查找每個部門工資最高前三名員工信息)

select * from (select deptno,ename,sal,dense_rank() over(partition by deptno order by sal desc) a from scott.emp) where a<=3 order by deptno asc,sal desc ;

結果:

--rank()分析函數(運行結果與上語句相同)

select * from (select deptno,ename,sal,rank() over(partition by deptno order by sal desc) a from scott.emp ) where a<=3 order by deptno asc,sal desc ;

結果:

--row_number()分析函數(運行結果與上相同)

select * from(select deptno,ename,sal,row_number() over(partition by deptno order by sal desc) a from scott.emp) where a<=3 order by deptno asc,sal desc ;

--rows unbounded preceding 分析函數(顯示各部門的積累工資總和)

select deptno,sal,sum(sal) over(order by deptno asc rows unbounded preceding) 積累工資總和 from scott.emp ;

結果:

--rows 整數值 preceding(顯示每最后4條記錄的匯總值)

select deptno,sal,sum(sal) over(order by deptno rows 3 preceding) 每4匯總值 from scott.emp ;

結果:

--rows between 1 preceding and 1 following(統計3條記錄的匯總值【當前記錄居中】)

select deptno,ename,sal,sum(sal) over(order by deptno rows between 1 preceding and 1 following) 匯總值 from scott.emp ;

結果:

--ratio_to_report(顯示員工工資及占該部門總工資的比例)

select deptno,sal,ratio_to_report(sal) over(partition by deptno) 比例 from scott.emp ;

結果:

--查看所有用戶

select * from dba_users ;

select count(*) from dba_users ;

select * from all_users ;

select * from user_users ;

select * from dba_roles ;

--查看用戶系統權限

select * from dba_sys_privs ;

select * from user_users ;

--查看用戶對象或角色權限

select * from dba_tab_privs ;

select * from all_tab_privs ;

select * from user_tab_privs ;

--查看用戶或角色所擁有的角色

select * from dba_role_privs ;

select * from user_role_privs ;

-- rownum:查詢10至12信息

select * from scott.emp a where rownum<=3 and a.empno not in(select b.empno from scott.emp b where rownum<=9);

結果:

--not exists;查詢emp表在dept表中沒有的數據

select * from scott.emp a where not exists(select * from scott.dept b where a.empno=b.deptno) ;

結果:

--rowid;查詢重復數據信息

關鍵詞標簽: 常用 語句

聲明: 本文由我的SEOUC技術文章主頁發布于:2023-05-22 ,文章oracle常用sql查詢語句部分集合(圖文)建站知識主要講述語句,常用,oracle常用sql查詢語句部分集合(圖文)建網站建設源碼以及服務器配置搭建相關技術文章。轉載請保留鏈接: http://www.bifwcx.com/article/web_5154.html

我的IDC 網站建設技術SEOUC.COM
專注網站建設,SEO優化,小程序設計制作搭建開發定制網站等,數千家網站定制開發案例,網站推廣技術服務。
  • 5000+合作客服
  • 8年從業經驗
  • 150+覆蓋行業
  • 最新熱門源碼技術文章

    主站蜘蛛池模板: 柘荣县| 大方县| 即墨市| 襄垣县| 都江堰市| 乌海市| 武威市| 武定县| 南华县| 襄城县| 长治县| 临沂市| 图木舒克市| 舟曲县| 上饶县| 阿坝| 汪清县| 潞西市| 岳普湖县| 新郑市| 巩义市| 叙永县| 盈江县| 永昌县| 甘泉县| 道真| 洛扎县| 加查县| 巴塘县| 石屏县| 拉萨市| 安仁县| 德钦县| 抚州市| 东港市| 乃东县| 阳谷县| 基隆市| 涡阳县| 和顺县| 卫辉市|