下载

3下载券

加入VIP
  • 专属下载特权
  • 现金文档折扣购买
  • VIP免费专区
  • 千万文档免费下载

上传资料

关闭

关闭

关闭

封号提示

内容

首页 《跟我学Java 26日通》第 1 天 Oracle基本命令与简单查询(笔记02)

《跟我学Java 26日通》第 1 天 Oracle基本命令与简单查询(笔记02).pdf

《跟我学Java 26日通》第 1 天 Oracle基本命令与…

bjchengzhimin
2009-10-21 0人阅读 举报 0 0 0 暂无简介

简介:本文档为《《跟我学Java 26日通》第 1 天 Oracle基本命令与简单查询(笔记02)pdf》,可适用于IT/计算机领域

SQLscottempMLDNMLDNEMPNoEMPNONUMBER()ENAMEVARCHAR()JOBVARCHAR()MGRNUMBER()HIREDATEDATESALNUMBER(,)COMMNUMBER(,)DEPTNONUMBER()deptdeptNoDEPTNONUMBER()DNAMEVARCHAR()LOCVARCHAR()SALGRADESALGRADENoGRADENUMBERLOSALNUMBERHISALNUMBERBONUSMLDNBONUSNoENAMEVARCHAR()JOBVARCHAR()SALNUMBERCOMMNUMBEROraclesqlpluswDISTINCTOracleSQLSQLSQLSQLStructuredQueryLanguageSQLANSISQLSQLDMLDataManipulationLanguageDDLDataDefinitionLanguageDCLDataControlLanguageSELECT*|FROMSELECT*FROMempSELECTempno,ename,jobFROMempMLDNSELECTempno,ename,jobFROMempjobSELECTjobFROMempMLDNDISTINCTSELECT{DISTINCT}*|FROMSELECTDISTINCTempno,jobFROMempSMITHCLERKMLDNOracle||'SELECT''||empno||''||ename||''||jobFROMempSELECTename,sal*FROMempsal*SELECTename,sal*incomeFROMemp*MLDNWHERESELECT{DISTINCT}*|FROM{WHERE(s)}sal>SELECT*FROMempWHEREsal>commISNOTSELECT*FROMempWHEREcommISNOTMLDNcommISSELECT*FROMempWHEREcommISANDSELECT*FROMempWHEREsal>ANDcommISNOTORSELECT*FROMempWHEREsal>ORcommISNOTMLDNNOTSELECT*FROMempWHERENOT(sal>ANDcommISNOT)SELECT*FROMempWHEREsal>ANDsal<sal>sal<SQLBETWEEN…AND…BETWEENANDSELECT*FROMempWHEREsalBETWEENANDBETWEEN…ANDMLDNBETWEEN…ANDsal>=ANDsal<=~'SELECT*FROMempWHEREhiredateBETWEEN''AND''BETWEEN…ANDsmithename='smith'SELECT*FROMempWHEREename='smith'smithOracleSELECT*FROMempWHEREename='SMITH'MLDNOR|empno=ORempno=ORempno=SELECT*FROMempWHEREempno=ORempno=ORempno=SQLININ(,,…,n)NOTINNOTIN(,,…,n)SELECT*FROMempWHEREempnoIN(,,)MLDNSELECT*FROMempWHEREempnoNOTIN(,,)INSMITHALLENKINGSELECT*FROMempWHEREenameIN('SMITH','ALLEN','KING')SELECT*FROMempWHEREenameIN('SMITH','ALLEN','KING','#$#$$##$')SQLLIKELIKELIKEMLDNMSELECT*FROMempWHEREenameLIKE'M'MMSELECT*FROMempWHEREenameLIKE'M'LIKESELECT*FROMempWHEREenameLIKE''MLDNLIKESELECT*FROMempWHEREhiredateLIKE''SELECT*FROMempWHEREsalLIKE''MLDN>>==<<=SQL<>!=<>SELECT*FROMempWHEREempno<>!=SELECT*FROMempWHEREempno!=MLDNORDERBYSQLORDERBYSELECT*FROMempORDERBYSELECT{DISTINCT}*|FROM{WHERE(s)}{ORDERBY,ASC|DESC}ASCDESCSELECT*FROMempORDERBYsalMLDNSELECT*FROMempORDERBYsalASCDESCSELECT*FROMempORDERBYsalDESCMLDNSELECT*FROMempWHEREdeptno=ORDERBYsalDESC,hiredateASCSQLfunctionname(column|expression,arg,arg,…)functionnamecolumnexpressionargargNVLDECODEMLDNSELECTUPPER('smith')FROMDUALupperSELECT*FROMempWHEREename=UPPER('Smith')lower()SELECTLOWER('HELLOWORLD')FROMdualinitcap()SELECTINITCAP('HELLOWORLD')FROMdualMLDNSELECTINITCAP(ename)FROMemp||CONCAT()SELECTCONCAT('hello','world')FROMDUALMLDN||substr()length()replace()SELECTsubstr('hello',,),length('hello'),replace('hello','l','x')FROMDUALsubstr()Oraclesubstr()|OracleSELECTename,SUBSTR(ename,LENGTH(ename))FROMempsubstr()SELECTename,SUBSTR(ename,,)FROMempMLDNROUND()TRUNC()MODSELECTROUND()FROMdualROUND()SELECTROUND(,)FROMdualROUND()SELECTROUND(,)FROMdualMLDNTRUNC()ROUND()TRUNC()TRUNC()SELECTTRUNC()FROMDUALTRUNC()SELECTTRUNC(,)FROMDUALSELECTTRUNC(,)FROMDUALMLDNMOD()SELECTMOD(,)FROMDUALOracle–==–=OraclesysdateSELECTSYSDATEFROMDUAL–==SELECTempno,ename,ROUND((SYSDATEhiredate))FROMempMLDNOracleMONTHSBETWEEN()ADDMONTHS()NEXTDAY()LASTDAY()MONTHSBETWEEN()SELECTempno,ename,MONTHSBETWEEN(sysdate,hiredate)FROMempROUND()MLDNADDMONTHS()SELECTADDMONTHS(SYSDATE,)FROMDUALNEXTDAY()SELECTNEXTDAY(SYSDATE,'')FROMDUALLASTDAY()SELECTLASTDAY(SYSDATE)FROMDUALMLDNTOCHAR()TONUMBER()TODATE()SELECTempno,ename,hiredateFROMempTOCHAR()yyyyymmmdddSELECTempno,ename,TOCHAR(hiredate,'yyyy')year,TOCHAR(hiredate,'mm')months,TOCHAR(hiredate,'dd')dayFROMemptochar()OracleSELECTempno,ename,TOCHAR(hiredate,'yyyymmdd')FROMempMLDNfmtochar()SELECTempno,ename,salFROMemp,tochar()SELECTempno,ename,TOCHAR(sal,',')FROMempMLDN$LLocalSELECTempno,ename,TOCHAR(sal,'$,')FROMempTONUMBERSELECTTONUMBER('')TONUMBER('')FROMDUALTODATE()DATEDATESELECTTODATE('','yyyymmdd')FROMDUALMLDNsalcomm*SELECTempno,ename,(salcomm)*FROMempNVLSELECTempno,ename,NVL(comm,),(salNVL(comm,))*incomeFROMempMLDNNVL()DECODE()DECODE()IF…ELSEIF…ELSEDECODE(colexpression,search,result,search,result,,default)colexpressionsearchsearchsearchiresultresultresulticolexpressionsearchiresulticolexpressiondefaultDECODE()SELECTDECODE(,,'',,'',,'')FROMDUALempMLDN|CLERK|SALESMAN|MANAGER|ANALYST|PRESIDENTSELECTempno,ename,hiredate,DECODE(job,'CLERK','','SALESMAN','','MANAGER','','ANALYST','','PRESIDENT','')FROMempDECODEMLDNMLDNOraclesyschangeoninstallsystemmanagerscotttigersqlpluswsetlinesizesetpagesizeedconnASSYSDBASQLDECODE()scottSQL

用户评价(0)

关闭

新课改视野下建构高中语文教学实验成果报告(32KB)

抱歉,积分不足下载失败,请稍后再试!

提示

试读已结束,如需要继续阅读或者下载,敬请购买!

评分:

/34

VIP

在线
客服

免费
邮箱

爱问共享资料服务号

扫描关注领取更多福利