校园春色亚洲色图_亚洲视频分类_中文字幕精品一区二区精品_麻豆一区区三区四区产品精品蜜桃

主頁(yè) > 知識(shí)庫(kù) > oracle常用sql查詢語(yǔ)句部分集合(圖文)

oracle常用sql查詢語(yǔ)句部分集合(圖文)

熱門標(biāo)簽:阿爾巴尼亞地圖標(biāo)注app 征服眼公司地圖標(biāo)注 外呼線路外顯本地號(hào)碼 人工智能地圖標(biāo)注自己能做嗎 征服者火車站地圖標(biāo)注 開封智能外呼系統(tǒng)廠家 百度地圖標(biāo)注素材 美圖秀秀地圖標(biāo)注 word地圖標(biāo)注方向

Oracle查詢語(yǔ)句

select * from scott.emp ;

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

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 ;

結(jié)果:

--rank()分析函數(shù)(運(yùn)行結(jié)果與上語(yǔ)句相同)

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 ;

結(jié)果:

--row_number()分析函數(shù)(運(yùn)行結(jié)果與上相同)

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 分析函數(shù)(顯示各部門的積累工資總和)

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

結(jié)果:

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

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

結(jié)果:

--rows between 1 preceding and 1 following(統(tǒng)計(jì)3條記錄的匯總值【當(dāng)前記錄居中】)

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

結(jié)果:

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

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

結(jié)果:

--查看所有用戶

select * from dba_users ;

select count(*) from dba_users ;

select * from all_users ;

select * from user_users ;

select * from dba_roles ;

--查看用戶系統(tǒng)權(quán)限

select * from dba_sys_privs ;

select * from user_users ;

--查看用戶對(duì)象或角色權(quán)限

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);

結(jié)果:

--not exists;查詢emp表在dept表中沒(méi)有的數(shù)據(jù)

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

結(jié)果:

--rowid;查詢重復(fù)數(shù)據(jù)信息

select * from scott.emp a where a.rowid>(select min(x.rowid) from scott.emp x where x.empno=a.empno);

--根據(jù)rowid來(lái)分頁(yè)(一萬(wàn)條數(shù)據(jù),查詢10000至9980時(shí)間大概在0.03秒左右)

select * from scott.emp where rowid in(select rid from(select rownum rn,rid from(select rowid rid,empno from scott.emp order by empno desc) where rownum10)where rn>=1)order by empno desc ;

結(jié)果:

--根據(jù)分析函數(shù)分頁(yè)(一萬(wàn)條數(shù)據(jù),查詢10000至9980時(shí)間大概在1.01秒左右)

select * from(select a.*,row_number() over(order by empno desc) rk from scott.emp a ) where rk10 and rk>=1;

結(jié)果:

--rownum分頁(yè)(一萬(wàn)條數(shù)據(jù),查詢10000至9980時(shí)間大概在0.01秒左右)

select * from(select t.*,rownum rn from(select * from scott.emp order by empno desc)t where rownum10) where rn>=1;

select * from(select a.*,rownum rn from (select * from scott.emp) a where rownum=10) where rn>=5 ;

--left outer join:左連接

select a.*,b.* from scott.emp a left outer join scott.dept b on a.deptno=b.deptno ;

--right outer join:右連接

select a.*,b.* from scott.emp a right outer join scott.dept b on a.deptno=b.deptno ;

--inner join

select a.*,b.* from scott.emp a inner  join scott.dept b on a.deptno=b.deptno ;

--full join

select a.*,b.* from scott.emp a full join scott.dept b on a.deptno=b.deptno ;

select a.*,b.* from scott.emp a,scott.dept b where a.deptno(+)=b.deptno ;

select distinct ename,sal from scott.emp a group by sal having ;

select * from scott.dept ;

select * from scott.emp ;

--case when then end (交叉報(bào)表)

select ename,sal,case deptno when 10 then '會(huì)計(jì)部' when 20 then '研究部' when 30 then '銷售部' else '其他部門' end 部門 from scott.emp ;

結(jié)果:

select ename,sal,case when sal>0 and sal1500 then '一級(jí)工資' when sal>=1500 and sal3000 then '二級(jí)工資' when sal>=3000 and sal4500 then '三級(jí)工資' else '四級(jí)工資' end 工資等級(jí) from scott.emp order by sal desc ;

結(jié)果:

--交叉報(bào)表是使用分組函數(shù)與case結(jié)構(gòu)一起實(shí)現(xiàn)

select 姓名,sum(case 課程 when '數(shù)學(xué)' then 分?jǐn)?shù) end)數(shù)學(xué),sum(case 課程 when '歷史' then 分?jǐn)?shù) end)歷史 from 學(xué)生 group by 姓名 ;

--decode 函數(shù)

select 姓名,sum(decode(課程,'數(shù)學(xué)',分?jǐn)?shù),null))數(shù)學(xué),sum(decode(課程,'語(yǔ)文',分?jǐn)?shù),null))語(yǔ)文,sum(decode(課程,'歷史','分?jǐn)?shù)',null))歷史 from 學(xué)生 group by 姓名 ;

--level。。。。connect by(層次查詢)

select level,emp.* from scott.emp connect by prior empno = mgr order by level ;

結(jié)果:

--sys_connect_by_path函數(shù)

select ename,sys_connect_by_path(ename,'/') from scott.emp start with mgr is null connect by prior empno=mgr ;

結(jié)果:

--start with connect by prior 語(yǔ)法

select lpad(ename,3*(level),'')姓名,lpad(ename,3*(level),'')姓名 from scott.emp where job>'CLERK' start with mgr is null connect by prior mgr = empno ;

--level與prior關(guān)鍵字

select level,emp.* from scott.emp start with ename='SCOTT' connect by prior empno=mgr;

select level,emp.* from scott.emp start with ename='SCOTT' connect by empno = prior mgr ;

結(jié)果:

--等值連接

select empno,ename,job,sal,dname from scott.emp a,scott.dept b where a.deptno=b.deptno and (a.deptno=10 or sal>2500);

結(jié)果:

--非等值連接

select a.ename,a.sal,b.grade from scott.emp a,scott.salgrade b where a.sal between b.losal and b.hisal ;

結(jié)果:

--自連接

select a.ename,a.sal,b.ename from scott.emp a,scott.emp b where a.mgr=b.empno ;

結(jié)果:

--左外連接

select a.ename,a.sal,b.ename from scott.emp a,scott.emp b where a.mgr=b.empno(+);

結(jié)果:

--多表連接

select * from scott.emp ,scott.dept,scott.salgrade where scott.emp.deptno=scott.dept.deptno and scott.emp.sal between scott.salgrade.losal and scott.salgrade.hisal ;

結(jié)果:

select * from scott.emp a join scott.dept b on a.deptno=b.deptno join scott.salgrade s on a.sal between s.losal and s.hisal where a.sal>1000;

select * from(select * from scott.emp a join scott.dept b on a.deptno=b.deptno where a.sal>1000) c join scott.salgrade s on c.sal between s.losal and s.hisal ;

--單行子查詢

select * from scott.emp a where a.deptno=(select deptno from scott.dept where loc='NEW YORK');

select * from scott.emp a where a.deptno in (select deptno from scott.dept where loc='NEW YORK');

結(jié)果:

--單行子查詢?cè)?from 后

select scott.emp.*,(select deptno from scott.dept where loc='NEW YORK') a from scott.emp ;

--使用 in ,all,any 多行子查詢

--in:表示等于查詢出來(lái)的對(duì)應(yīng)數(shù)據(jù)

select ename,job,sal,deptno from scott.emp where job in(select distinct job from scott.emp where deptno=10);

--all:表示大于所有括號(hào)中查詢出來(lái)的對(duì)應(yīng)的數(shù)據(jù)信息

select ename,sal,deptno from scott.emp where sal>all(select sal from scott.emp where deptno=30);

--any:表示大于括號(hào)查詢出來(lái)的其中任意一個(gè)即可(只隨機(jī)一個(gè))

select ename,sal,deptno from scott.emp where sal>any(select sal from scott.emp where deptno=30);

--多列子查詢

select ename,job,sal,deptno from scott.emp where(deptno,job)=(select deptno,job from scott.emp where ename='SCOTT');

select ename,job,sal,deptno from scott.emp where(sal,nvl(comm,-1)) in(select sal,nvl(comm,-1) from scott.emp where deptno=30);

--非成對(duì)比較

select ename,job,sal,deptno from scott.emp where sal in(select sal from scott.emp where deptno=30) and nvl(comm,-1) in(select nvl(comm,-1) from scott.emp where deptno=30);

--其他子查詢

select ename,job,sal,deptno from scott.emp where exists(select null from scott.dept where scott.dept.deptno=scott.emp.deptno and scott.dept.loc='NEW YORK');

select ename,job,sal from scott.emp join(select deptno,avg(sal) avgsal,null from scott.emp group by deptno) dept on emp.deptno=dept.deptno where sal>dept.avgsal ;

create table scott.test(

       ename varchar(20),

       job varchar(20)

);

--drop table test ;

select * from scott.test ;

--Insert與子查詢(表間數(shù)據(jù)的拷貝)

insert into scott.test(ename,job) select ename,job from scott.emp ;

--Update與子查詢

update scott.test set(ename,job)=(select ename,job from scott.emp where ename='SCOTT' and deptno ='10');

--創(chuàng)建表時(shí),還可以指定列名

create table scott.test_1(ename,job) as select ename,job from scott.emp ;

select * from scott.test_1 ;

--delete與子查詢

delete from scott.test where ename in('');

--合并查詢

--union語(yǔ)法(合并且去除重復(fù)行,且排序)

select ename,sal,deptno from scott.emp where deptno>10 union select ename,sal,deptno from scott.emp where deptno30 ;

select a.deptno from scott.emp a union select b.deptno from scott.dept b ;

--union all(直接將兩個(gè)結(jié)果集合并,不排序)

select ename,sal,deptno from scott.emp where deptno>10 union all select ename,sal,deptno from scott.emp where deptno30 ;

select a.deptno from scott.emp a union all select b.deptno from scott.dept b ;

--intersect:取交集

select ename,sal,deptno from scott.emp where deptno>10 intersect select ename,sal,deptno from scott.emp where deptno30;

--顯示部門工資總和高于雇員工資總和三分之一的部門名及工資總和

select dname as 部門,sum(sal) as 工資總和 from scott.emp a,scott.dept b where a.deptno=b.deptno group by dname having sum(sal)>(select sum(sal)/3 from scott.emp c,scott.dept d where c.deptno=d.deptno);

結(jié)果:

--使用with得到以上同樣的結(jié)果

with test as (select dname ,sum(sal) sumsal  from scott.emp ,scott.dept where scott.emp.deptno=scott.dept.deptno group by dname) select dname as 部門,sumsal as 工資總和 from scott.test where sumsal>(select sum(sumsal)/3 from scott.test);

結(jié)果:

--分析函數(shù)

select ename,sal,sum(sal) over(partition by deptno order by sal desc) from scott.emp ;

--rows n preceding(窗口子句一)

select deptno,sal,sum(sal) over(order by sal rows 5 preceding) from scott.emp ;

結(jié)果:

--rum(..) over(..)..

select sal,sum(1) over(order by sal) aa from scott.emp  ;

select deptno,ename,sal,sum(sal) over(order by ename) 連續(xù)求和,sum(sal) over() 總和,100*round(sal/sum(sal) over(),4) as 份額 from scott.emp;

結(jié)果:

select deptno,ename,sal,sum(sal) over(partition by deptno order by ename) 部門連續(xù)求和,sum(sal) over(partition by deptno) 部門總和,100*round(sal/sum(sal) over(),4) as 總份額 from scott.emp;

結(jié)果:

select deptno,sal,rank() over (partition by deptno order by sal),dense_rank() over(partition by deptno order by sal) from scott.emp order by deptno ;

結(jié)果;

select * from (select rank() over(partition by 課程 order by 分?jǐn)?shù) desc) rk,分析函數(shù)_rank.* from 分析函數(shù)_rank) where rk=3 ;

--dense_rank():有重復(fù)的數(shù)字不跳著排列

--row_number()

select deptno,sal,row_number() over(partition by deptno order by sal) rm from scott.emp ;

結(jié)果:

--lag()和lead()

select deptno,sal,lag(sal) over(partition by deptno order by sal) 上一個(gè),lead(sal) over(partition by deptno order by sal) from scott.emp ;

結(jié)果:

--max(),min(),avg()

select deptno,sal,max(sal) over(partition by deptno order by sal)最大,min(sal) over(partition by deptno order by sal)最小,avg(sal) over(partition by deptno order by sal)平均 from scott.emp ;

結(jié)果:

--first_value(),last_value()

select deptno,sal,first_value(sal) over(partition by deptno)最前,last_value(sal) over(partition by deptno )最后 from scott.emp ;

結(jié)果:

--分組補(bǔ)充 group by grouping sets

select deptno ,sal,sum(sal) from scott.emp group by grouping sets(deptno,sal);

select null,sal,sum(sal) from scott.emp group by sal union all select deptno,null,sum(sal) from scott.emp group by deptno ;

結(jié)果:

--rollup

select deptno,job,avg(sal) from scott.emp group by rollup(deptno,job) ;

--理解rollup等價(jià)于

select deptno,job,avg(sal) from scott.emp group by deptno,job union select deptno ,null,avg(sal) from scott.emp group by deptno union select null,null,avg(sal) from scott.emp ;

結(jié)果:

select deptno,job,avg(sal) a from scott.emp group by cube(deptno,job) ;

--理解CUBE

select deptno,job,avg(sal) from scott.emp group by cube(deptno,job) ;

--等價(jià)于

select deptno,job,avg(sal) from scott.emp group by grouping sets((deptno,job),(deptno),(job),());

結(jié)果:

--查詢工資不在1500至2850之間的所有雇員名及工資

select ename,sal from scott.emp where sal not in(select sal from scott.emp where sal between 1500 and 2850 );

--部門10和30中的工資超過(guò)1500的雇員名及工資

select deptno,ename,sal from scott.emp a where a.deptno in(10,30) and a.sal>1500 order by sal desc ;

結(jié)果:

--在1981年2月1日至1981年5月1日之間雇傭的雇員名,崗位及雇傭日期,并以雇傭日期先后順序排序

select ename as 姓名,job as 崗位,hiredate as 雇傭日期 from scott.emp a where a.hiredate between to_date('1981-02-01','yyyy-mm-dd') and to_date('1981-05-01','yyyy-mm-dd') order by a.hiredate asc ;

結(jié)果:

select * from scott.emp where hiredate >to_date('1981-02-01','yyyy-MM-dd');

--查詢獲得補(bǔ)助的所有雇傭名,工資及補(bǔ)助額,并以工資和補(bǔ)助的降序排序

select ename,sal,comm from scott.emp a where a.comm > all(0) order by comm desc;

--工資低于1500的員工增加10%的工資,工資在1500及以上的增加5%的工資并按工資高低排序(降序)

select ename as 員工姓名,sal as 補(bǔ)發(fā)前的工資,case when sal1500 then (sal+sal*0.1) else (sal+sal*0.05) end 補(bǔ)助后的工資 from scott.emp order by sal desc ;

結(jié)果:

--查詢公司每天,每月,每季度,每年的資金支出數(shù)額

select sum(sal/30) as 每天發(fā)的工資,sum(sal) as 每月發(fā)的工資,sum(sal)*3 as 每季度發(fā)的工資,sum(sal)*12 as 每年發(fā)的工資 from scott.emp;

結(jié)果:

--查詢所有員工的平均工資,總計(jì)工資,最高工資和最低工資

select avg(sal) as 平均工資,sum(sal) as 總計(jì)工資,max(sal) as 最高工資,min(sal) as 最低工資 from scott.emp;

結(jié)果:

--每種崗位的雇員總數(shù)和平均工資

select job as 崗位,count(job) as 崗位雇員總數(shù),avg(sal) as 平均工資 from scott.emp group by job order by 平均工資 desc;

結(jié)果:

--雇員總數(shù)以及獲得補(bǔ)助的雇員數(shù)

select count(*) as 公司雇員總數(shù),count(comm) as 獲得補(bǔ)助的雇員人數(shù) from scott.emp ;

--管理者的總?cè)藬?shù)

--雇員工資的最大差額

select max(sal),min(sal),(max(sal) - min(sal)) as 員工工資最大差額 from scott.emp ;

--每個(gè)部門的平均工資

select deptno,avg(sal) from scott.emp a group by a.deptno;

結(jié)果:

--查詢每個(gè)崗位人數(shù)超過(guò)2人的所有職員信息

select * from scott.emp a,(select c.job,count(c.job) as sl from scott.emp c group by c.job ) b where b.sl>2 and a.job=b.job;

結(jié)果:

select * from scott.emp a where a.empno in(select mgr from scott.emp ) and (select count(mgr) from scott.emp)>2 ;

結(jié)果:

--處理重復(fù)行數(shù)據(jù)信息(刪除,查找,修改)

select * from a1 a where not exists (select b.rd from (select rowid rd,row_number() over(partition by LOAN, BRANCH order by BEGIN_DATE desc) rn from a1) b where b.rn = 1 and a.rowid = b.rd);

--查詢emp表數(shù)據(jù)信息重復(fù)問(wèn)題

select * from scott.emp a where exists(select b.rd from(select rowid rd,row_number() over(partition by ename,job,mgr,hiredate,sal,comm,deptno order by empno asc) rn from scott.emp) b where b.rn=1 and a.rowid=b.rd);

--initcap:返回字符串,字符串第一個(gè)字母大寫

select initcap(ename) Upp from scott.emp ;

結(jié)果:

--ascii:返回與指定的字符對(duì)應(yīng)的十進(jìn)制數(shù)

select ascii(a.empno) as 編號(hào),ascii(a.ename) as 姓名,ascii(a.job) as 崗位 from scott.emp a ;

結(jié)果:

--chr:給出整數(shù),返回對(duì)應(yīng)的字符

select chr(ascii(ename)) as 姓名 from scott.emp ;

結(jié)果:

--concat:連接字符串

select concat(a.ename,a.job)|| a.empno as 字符連接 from scott.emp a;

結(jié)果:

--instr:在一個(gè)字符串中搜索指定的字符,返回發(fā)現(xiàn)指定的字符的位置

select instr(a.empno,a.mgr,1,1) from scott.emp a ;

--length:返回字符串的長(zhǎng)度

select ename,length(a.ename) as 長(zhǎng)度,a.job,length(a.job) as 長(zhǎng)度 from scott.emp a ;

--lower:返回字符串,并將所返回的字符小寫

select a.ename as 大寫,lower(a.ename) as 小寫 from scott.emp a ;

結(jié)果:

--upper:返回字符串,并將返回字符串都大寫

select lower(a.ename) as 小寫名字,upper(a.ename) as 大寫名字 from scott.emp a ;

結(jié)果:

--rpad:在列的右邊粘貼字符,lpad: 在列的左邊粘貼字符(不夠字符則用*來(lái)填滿)

select lpad(rpad(a.ename,10,'*'),16,'*') as 粘貼 from scott.emp a ;

結(jié)果:

--like不同角度的使用

select * from scott.emp where ename like '%XXR%';

select * from scott.emp where ename like '%S';

select * from scott.emp where ename like 'J%';

select * from scott.emp where ename like 'S';

select * from scott.emp where ename like '%S_';

--每個(gè)部門的工資總和

select a.ename,sum(sal) from scott.emp a group by ename;

--每個(gè)部門的平均工資

select a.deptno,avg(sal) from scott.emp a group by deptno ;

--每個(gè)部門的最大工資

select a.deptno,max(sal) from scott.emp a group by deptno ;

--每個(gè)部門的最小工資

select a.deptno,min(sal) from scott.emp a group by deptno ;

--查詢?cè)べY占部門工資的比率

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

--查詢成績(jī)不及格的所有學(xué)生信息(提示:沒(méi)有對(duì)應(yīng)的表,只是意思意思。不及格人數(shù)大于等于三才能查)

select * from scott.emp where empno in(select distinct empno from scott.emp where 3(select count(sal) from scott.emp where sal3000) and empno in(select empno from scott.emp where sal3000));

結(jié)果:

--查詢每個(gè)部門的平均工資

select distinct deptno,avg(sal) from scott.emp group by deptno  order by deptno desc;

--union組合查出的結(jié)果,但要求查出來(lái)的數(shù)據(jù)類型必須相同

select sal from scott.emp where sal >=all(select sal from scott.emp ) union select sal from scott.emp ;

select * from scott.emp a where a.empno between 7227 and 7369 ;--只能從小到大

---------創(chuàng)建表空間  要用擁有create tablespace權(quán)限的用戶,比如sys

create tablespace tbs_dat datafile 'c:\oradata\tbs_dat.dbf' size 2000M;

---------添加數(shù)據(jù)文件

alter tablespace tbs_dat add datafile 'c:\oradata\tbs_dat2.dbf' size 100M;

---------改變數(shù)據(jù)文件大小

alter database datafile 'c:\oradata\tbs_dat.dbf' resize 250M;

---------數(shù)據(jù)文件自動(dòng)擴(kuò)展大小

alter database datafile 'c:\oradata\tbs_dat.dbf' autoextend on next 1m maxsize 20m;

---------修改表空間名稱

alter tablespace tbs_dat rename to tbs_dat1;

---------刪除表空間  and datafiles 表示同時(shí)刪除物理文件

drop tablespace tbs_dat including contents and datafiles;

--substr(s1,s2,s3):截取s1字符串,從s2開始,結(jié)束s3

select substr(job,3,length(job)) from scott.emp ;

--replace:替換字符串

select replace(ename,'LL','aa') from scott.emp;

select * from scott.test;

insert into scott.test(ename,job) values('weather','好');

insert into scott.test(ename,job) values('wether','差');

--soundex:返回一個(gè)與給定的字符串讀音相同的字符串

select ename from scott.test where soundex(ename)=soundex('wether');

--floor:取整數(shù)

select sal,floor(sal) as 整數(shù) from scott.emp ;

--log(n,s):返回一個(gè)以n為低,s的對(duì)數(shù)

select empno,log(empno,2) as 對(duì)數(shù) from scott.emp ;

--mod(n1,n2):返回一個(gè)n1除以n2的余數(shù)

select empno,mod(empno,2) as 余數(shù) from scott.emp ;

結(jié)果:

--power(n1,n2):返回n1的n2次方根

select empno,power(empno,2) as 方根 from scott.emp ;

--round和trunc:按照指定的精度進(jìn)行舍入

select round(41.5),round(-41.8),trunc(41.6),trunc(-41.9) from scott.emp ;

--sign:取數(shù)字n的符號(hào),大于0返回1,小于0返回-1,等于0返回0

select sign(45),sign(-21),sign(0) from scott.emp ;

結(jié)果:

select * from scott.emp;

oracle相關(guān)的數(shù)據(jù)庫(kù)SQL查詢語(yǔ)句:

1.  在職員表中查詢出基本工資比平均基本工資高的職工編號(hào)。

2.  查詢一個(gè)或者多個(gè)部門的所有員工信息,該部門的所有員工工資都高于公司的平均工資。

3.  現(xiàn)有張三的出生日期:1985-01-15 01:27:36,請(qǐng)各自新建表,將此日期時(shí)間插入表中,并計(jì)算出張三的年齡,顯示張三的生日。

4.  生日的輸出格式要求為MM-DD(未滿兩位的用0不全),張三的生日為01-15。

5.  算年齡要求用三個(gè)方式實(shí)現(xiàn)。

6.  生日要求用兩個(gè)方式實(shí)現(xiàn)。

7.  在數(shù)據(jù)庫(kù)表中有以下字符數(shù)據(jù),如:

13-1,14-2,13-15,13-2,13-108,13-3,13-10,13-200,13-18,100-11,14-1

現(xiàn)在希望通過(guò)一條SQL語(yǔ)句進(jìn)行排序,并且首先要按照前半部分的數(shù)字進(jìn)行排序,然后再按照后半部分的數(shù)字進(jìn)行排序,輸出要拍成如下所示:
13-1,13-2,13-3,13-10,13-15,13-18,13-108,13-200,14-1,14-2,100-11

數(shù)據(jù)庫(kù)表名:SellRecord;字段ListNumber;

8.  顯示所有雇員的姓名以及滿10年服務(wù)年限后的日期。

9.  顯示雇員姓名,根據(jù)其服務(wù)年限,將最老的雇員排在最前面。

10顯示所有雇員的姓名和加入公司的年份和月份,按雇員受雇日期所在月排序,將最早年份的職員排在最前面。

10.             顯示假設(shè)一個(gè)月為30天的情況下所有雇員的日薪金。

11.             找出在(任何年份的)2月受聘的所有雇員(用兩種方式實(shí)現(xiàn))。

12.             對(duì)于每個(gè)雇員,顯示其加入公司的天數(shù)。

13.             以年,月和日的方式顯示所有雇員的服務(wù)年限(入職多少年/入職了多少月/入職了多少天)。

14.             找出各月最后一天受雇的所有雇員。

15.             找出早于25年之前受雇的雇員(用兩種方式實(shí)現(xiàn))。

16.             工資最低1500的職員增加10%,1500以上的增加5%的工資,用一條update語(yǔ)句實(shí)現(xiàn)(用兩種方式實(shí)現(xiàn))。

17.             按照部門統(tǒng)計(jì)每種崗位的平均工資,要求輸出的格式如下圖所示:

18.

19.

20.

21,。

22.

本人聲明:以上內(nèi)容出現(xiàn)任何錯(cuò)誤與不足,皆與本人無(wú)關(guān)。

您可能感興趣的文章:
  • Oracle 11GR2的遞歸WITH子查詢方法
  • Oracle基礎(chǔ)學(xué)習(xí)之子查詢
  • Oracle數(shù)據(jù)庫(kù)中基本的查詢優(yōu)化與子查詢優(yōu)化講解
  • Oracle通過(guò)遞歸查詢父子兄弟節(jié)點(diǎn)方法示例
  • 一個(gè)oracle+PHP的查詢的例子
  • oracle基本查詢用法入門示例
  • oracle 查詢表名以及表的列名
  • oracle查詢語(yǔ)句大全(oracle 基本命令大全一)
  • oracle數(shù)據(jù)庫(kù)常用的99條查詢語(yǔ)句
  • ORACLE查詢刪除重復(fù)記錄三種方法
  • oracle基本查詢操作子查詢用法實(shí)例分析

標(biāo)簽:孝感 淮南 海北 宜春 酒泉 葫蘆島 六安 泰安

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《oracle常用sql查詢語(yǔ)句部分集合(圖文)》,本文關(guān)鍵詞  oracle,常用,sql,查詢,語(yǔ)句,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《oracle常用sql查詢語(yǔ)句部分集合(圖文)》相關(guān)的同類信息!
  • 本頁(yè)收集關(guān)于oracle常用sql查詢語(yǔ)句部分集合(圖文)的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    校园春色亚洲色图_亚洲视频分类_中文字幕精品一区二区精品_麻豆一区区三区四区产品精品蜜桃
    国产**成人网毛片九色| 7777女厕盗摄久久久| 亚洲精品免费播放| 26uuu精品一区二区三区四区在线| 色综合久久久久| 99久久综合色| 大白屁股一区二区视频| 国产福利一区二区三区| 久久99精品久久久久| 蜜臀av亚洲一区中文字幕| 日韩精品欧美成人高清一区二区| 一区二区高清视频在线观看| 一区二区久久久| 欧美电视剧在线看免费| 欧美一区二区黄色| 欧美电影免费观看高清完整版| 精品国产一区二区国模嫣然| 精品成人a区在线观看| 久久久久综合网| 亚洲欧洲精品成人久久奇米网| 国产精品二三区| 一区二区三区欧美激情| 午夜在线成人av| 精品一区二区三区蜜桃| 成人免费毛片app| 欧美日韩综合在线免费观看| 91精品国产美女浴室洗澡无遮挡| 日韩视频在线你懂得| 国产欧美日本一区二区三区| 亚洲免费成人av| 蜜桃av噜噜一区| av不卡在线播放| 欧美一三区三区四区免费在线看| 久久久久久毛片| 亚洲精品国产一区二区精华液 | 中文字幕av一区二区三区高| 亚洲丝袜制服诱惑| 日韩国产在线一| 国产91在线观看| 欧美色精品天天在线观看视频| 日韩一区二区三区四区五区六区| 国产亚洲成av人在线观看导航| 亚洲欧洲日韩综合一区二区| 老汉av免费一区二区三区 | 97久久超碰精品国产| 欧美一区二区三区的| 亚洲欧洲av另类| 国产一区欧美日韩| 欧美视频日韩视频在线观看| 日本黄色一区二区| 久久综合视频网| 日韩av一二三| 一本在线高清不卡dvd| 久久免费美女视频| 日韩成人免费电影| 日本韩国欧美一区| 日本一区二区三区dvd视频在线| 亚洲六月丁香色婷婷综合久久| 国产一区二区看久久| 91麻豆精品国产91久久久久久久久 | 高清久久久久久| 欧美一级高清片| 一区二区三区在线视频观看58 | 在线亚洲高清视频| 中文字幕乱码一区二区免费| 久久97超碰国产精品超碰| 欧美日韩国产精品成人| 亚洲天堂福利av| 成人激情免费电影网址| 精品国产免费人成在线观看| 午夜精品久久久久久久久| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 成人免费黄色在线| 日韩欧美中文字幕公布| 亚洲国产精品一区二区久久恐怖片| 国产**成人网毛片九色 | 色综合视频一区二区三区高清| 久久青草国产手机看片福利盒子| 天堂成人国产精品一区| 欧美午夜在线观看| 一区二区三区鲁丝不卡| 91丨porny丨国产入口| 日韩伦理av电影| 91女人视频在线观看| 亚洲欧美aⅴ...| 在线观看国产精品网站| 亚洲国产人成综合网站| 欧美久久久久免费| 日本欧美一区二区在线观看| 欧美片在线播放| 日本不卡不码高清免费观看 | 一区二区三区成人| 欧洲精品中文字幕| 午夜精品久久久久久久久久久| 欧美日韩三级一区二区| 日韩成人精品在线| 精品国产一区二区三区四区四| 国产精品中文有码| 自拍偷在线精品自拍偷无码专区| 97aⅴ精品视频一二三区| 一片黄亚洲嫩模| 欧美挠脚心视频网站| 另类小说图片综合网| 国产无遮挡一区二区三区毛片日本| 高清不卡一二三区| 亚洲精品久久嫩草网站秘色| 欧美精品乱码久久久久久按摩| 久久av资源站| 亚洲图片另类小说| 91精品国产91热久久久做人人 | 日本久久电影网| 日韩经典一区二区| 久久精品视频免费| 欧美午夜片在线看| 国产麻豆视频精品| 尤物av一区二区| 欧美精品一区二区三区高清aⅴ| 福利视频网站一区二区三区| 国产欧美日韩在线看| 色视频一区二区| 热久久一区二区| 亚洲国产精品激情在线观看| 欧美日韩三级视频| 成人高清视频免费观看| 视频一区欧美精品| 1000部国产精品成人观看| 欧美日韩国产免费一区二区| 成人一区二区三区| 免费人成在线不卡| 亚洲人成电影网站色mp4| 日韩精品在线一区| 在线观看日韩一区| 成人黄色a**站在线观看| 日韩成人伦理电影在线观看| 亚洲天堂2014| 国产欧美日韩在线看| 日韩视频在线一区二区| 在线视频你懂得一区| 99久久精品国产一区二区三区 | 欧美精品国产精品| 大桥未久av一区二区三区中文| 日本美女视频一区二区| 亚洲精品大片www| 国产精品三级视频| wwww国产精品欧美| 日韩欧美黄色影院| 在线成人高清不卡| 欧美日韩高清一区二区三区| 色综合久久天天| 99精品欧美一区| 国产成人在线色| 韩国在线一区二区| 久久99久久99小草精品免视看| 午夜a成v人精品| 亚洲.国产.中文慕字在线| 成人欧美一区二区三区小说| 欧美韩国日本一区| 国产亚洲短视频| 久久久久久久久久久久久久久99| 日韩精品一区在线观看| 日韩一区二区在线观看视频 | av不卡免费在线观看| 国产精品一区在线观看你懂的| 激情av综合网| 国产激情一区二区三区四区| 国产在线精品不卡| 国产99久久精品| 成人免费视频免费观看| www.欧美日韩国产在线| 成人国产精品免费观看动漫| 成人免费不卡视频| 9人人澡人人爽人人精品| 99热国产精品| 欧美性猛交xxxx乱大交退制版| 在线观看免费成人| 日韩一区二区在线看| 久久久久久久久岛国免费| 中文字幕乱码日本亚洲一区二区| 国产精品久久久久久久第一福利| 国产精品色哟哟网站| 亚洲免费观看高清完整| 日韩国产欧美视频| 国产一区二区三区四区五区入口 | 日韩精品一区二区三区swag| 久久久午夜精品| 最好看的中文字幕久久| 丝袜亚洲另类丝袜在线| 日产国产高清一区二区三区| 开心九九激情九九欧美日韩精美视频电影 | 午夜精品一区二区三区电影天堂| 香蕉成人伊视频在线观看| 男男视频亚洲欧美| 成人性生交大片免费看在线播放| 91老师片黄在线观看| 欧美一级片在线| 国产精品高潮呻吟久久| 天天爽夜夜爽夜夜爽精品视频| 韩国女主播一区二区三区| 99久久精品国产观看| 8x8x8国产精品|