常用oracle的系统函数、过程和包

常用oracle的系统函数、过程和包

ID:34763975

大小:146.68 KB

页数:20页

时间:2019-03-10

常用oracle的系统函数、过程和包_第1页
常用oracle的系统函数、过程和包_第2页
常用oracle的系统函数、过程和包_第3页
常用oracle的系统函数、过程和包_第4页
常用oracle的系统函数、过程和包_第5页
资源描述:

《常用oracle的系统函数、过程和包》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库

1、*SQL常用函数:数值函数:*ABSPurpose返回绝对值Returnstheabsolutevalueofn.ExampleSELECTABS(-15)"Absolute"FROMDUAL;Absolute----------15*CEILPurpose取最小整数Returnssmallestintegergreaterthanorequalton.ExampleSELECTCEIL(15.7)"Ceiling"FROMDUAL;Ceiling----------16*MODSyntaxMOD(m,n)Purpose取余Returnsremainderofmd

2、ividedbyn.Returnsmifnis0.ExampleSELECTMOD(11,4)"Modulus"FROMDUAL;Modulus----------3*ROUNDSyntaxROUND(n[,m])Purpose取四舍五入信息Returnsnroundedtomplacesrightofthedecimalpoint;ifmisomitted,to0places.mcanbenegativetoroundoffdigitsleftofthedecimalpoint.mmustbeaninteger.Example1SELECTROUND(15.19

3、3,1)"Round"FROMDUAL;Round----------15.2Example2SELECTROUND(15.193,-1)"Round"FROMDUAL;Round----------20 *TRUNCPurpose取截取后的信息Returnsntruncatedtomdecimalplaces;ifmisomitted,to0places.mcanbenegativetotruncate(makezero)mdigitsleftofthedecimalpoint.ExamplesSELECTTRUNC(15.79,1)"Truncate"FROM

4、DUAL;Truncate----------15.7SELECTTRUNC(15.79,-1)"Truncate"FROMDUAL;Truncate----------10字符函数:*CONCATSyntaxCONCAT(char1,char2)Purpose合并字符串,相当于“

5、

6、”Returnschar1concatenatedwithchar2.Thisfunctionisequivalenttotheconcatenationoperator(

7、

8、).Forinformationonthisoperator,see"ConcatenationOperat

9、or".ExampleThisexampleusesnestingtoconcatenatethreecharacterstrings:SELECTCONCAT(CONCAT(ename,'isa'),job)"Job"FROMempWHEREempno=7900;Job-----------------JAMESisaCLERK *LOWERPurpose变为小写Returnschar,withallletterslowercase.Thereturnvaluehasthesamedatatypeastheargumentchar(CHARorVARCHAR2)

10、.ExampleSELECTLOWER('MR.SCOTTMCMILLAN')"Lowercase"FROMDUAL;Lowercase--------------------mr.scottmcmillan*LPADPurpose左填充Returnschar1,left-paddedtolengthnwiththesequenceofcharactersinchar2;char2defaultstoasingleblank.Ifchar1islongerthann,thisfunctionreturnstheportionofchar1thatfitsinn.T

11、heargumentnisthetotallengthofthereturnvalueasitisdisplayedonyourterminalscreen.Inmostcharactersets,thisisalsothenumberofcharactersinthereturnvalue.However,insomemultibytecharactersets,thedisplaylengthofacharacterstringcandifferfromthenumberofcharactersinthestring.ExampleSELECTLPAD('Pa

12、ge1',

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。